How to configure custom LSP correctly #8682

Open
opened 2026-02-16 18:10:34 -05:00 by yindo · 2 comments
Owner

Originally created by @chenai02 on GitHub (Feb 6, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

I want to configure a custom lsp protocol for diagnosis. I will place the configured opencode.exe in the project root directory and execute it opencode debug lsp diagnostics entry\src\main\ets\view\NewsList.ets, But the returned result is empty. Upon checking the logs, it was found that OpenCode sent an initialization request in the form of STDIN. After processing the initialization request, OpenCode stopped diagnosing.

Originally created by @chenai02 on GitHub (Feb 6, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question I want to configure a custom lsp protocol for diagnosis. I will place the configured opencode.exe in the project root directory and execute it opencode debug lsp diagnostics entry\src\main\ets\view\NewsList.ets, But the returned result is empty. Upon checking the logs, it was found that OpenCode sent an initialization request in the form of STDIN. After processing the initialization request, OpenCode stopped diagnosing.
yindo added the docs label 2026-02-16 18:10:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #742: LSP Diagnostics return nothing in large project - similar symptom of empty results from opencode debug lsp diagnostics
  • #2737: Custom LSPs seem to not work - direct duplicate for custom LSP configuration issues
  • #8187: jdtls lsp custom config failed - similar initialization and diagnostic retrieval problems
  • #3297: How to get the model to use LSP correctly? - custom LSP configuration via opencode.json
  • #7405: How to configure LSP? - general LSP configuration guidance
  • #10978: lsp documentation needs enhancement - related documentation/configuration clarity issue

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 6, 2026): This issue might be a duplicate of existing issues. Please check: - #742: LSP Diagnostics return nothing in large project - similar symptom of empty results from `opencode debug lsp diagnostics` - #2737: Custom LSPs seem to not work - direct duplicate for custom LSP configuration issues - #8187: jdtls lsp custom config failed - similar initialization and diagnostic retrieval problems - #3297: How to get the model to use LSP correctly? - custom LSP configuration via opencode.json - #7405: How to configure LSP? - general LSP configuration guidance - #10978: lsp documentation needs enhancement - related documentation/configuration clarity issue Feel free to ignore if none of these address your specific case.
Author
Owner

@chenai02 commented on GitHub (Feb 6, 2026):

{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"arkts-lang-server": {
"command": [
"node",
"C:\Users\Administrator\testLSP\dist\bundle.js",
"${workspaceRoot}",
"D:\JetBrains\workspace\extension0120\Client\src\vscode\lang-server"
],
"extensions": [".ts", ".js", ".json", ".md"],
"initialization": {
"workspaceRoot": "${workspaceRoot}"
}
}
}
}
这是我的opencode内容

@chenai02 commented on GitHub (Feb 6, 2026): { "$schema": "https://opencode.ai/config.json", "lsp": { "arkts-lang-server": { "command": [ "node", "C:\\Users\\Administrator\\testLSP\\dist\\bundle.js", "${workspaceRoot}", "D:\\JetBrains\\workspace\\extension0120\\Client\\src\\vscode\\lang-server" ], "extensions": [".ts", ".js", ".json", ".md"], "initialization": { "workspaceRoot": "${workspaceRoot}" } } } } 这是我的opencode内容
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8682