You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use opencode for embedded development. and I found LSP report many error and warning to AI assistant.
and assistant always want to fix it. but it is LSP error. LSP haven't found them.
Like below:
Error [5:10] 'FreeRTOS.h' file not found
Error [27:8] Unknown type name 'w25qxx_io_t'
Error [47:18] Call to undeclared library function 'strlen' with type 'unsigned long long (const char *)'; ISO C99 and later do not support implicit function declarations
So my question is how to configure LSP make the LSP report correct information to AI assistant. or can we disable this report?
I was wondering as well. The docs say clangd is used as the LSP for C++ projects. I have tried adding .clangd config file into my project root with the contents
You can use a project-level opencode.jsonc to override the global config if your different projects uses different clangd and/or with different clangd configuration. My own use-case is not embedded development but at least for my own use-case (MSYS2 C++ development) it works as intended.
LSP diagnostics are fed to the AI assistant to help it understand your code — but if a particular LSP server is producing noisy or incorrect diagnostics (like missing headers or unknown types for embedded development), you can configure or disable it.
To disable LSP entirely:
{ "lsp": false }
To disable a specific LSP server (e.g. clangd which is likely causing your C errors):
{
"lsp": {
"clangd": { "disabled": true }
}
}
To keep LSP enabled but configure it, you can pass initialization options or environment variables. For clangd specifically, you might want to configure your compile commands (compile_commands.json) to fix the missing header errors at the source.
Activity
github-actions commentedon Jan 9, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
zbynekwinkler commentedon Jan 12, 2026
I was wondering as well. The docs say
clangdis used as the LSP for C++ projects. I have tried adding.clangdconfig file into my project root with the contentsand I've finally fixed this issue for myself. For reference see https://clangd.llvm.org/config.html#compilationdatabase
mmsaki commentedon Mar 8, 2026
start opencode with
Fix opencode solargraph lsp
Fix opencode solargraph lsp
BLumia commentedon Apr 1, 2026
Based on current codebase, one can configure
clangdusing the following config:{ "$schema": "https://opencode.ai/config.json", "lsp": { "clangd": { "command": ["C:\\msys64\\ucrt64\\bin\\clangd.exe", "--background-index", "--clang-tidy"] } } }You can use a project-level
opencode.jsoncto override the global config if your different projects uses different clangd and/or with different clangd configuration. My own use-case is not embedded development but at least for my own use-case (MSYS2 C++ development) it works as intended.JinkaiNiu commentedon May 23, 2026
LSP diagnostics are fed to the AI assistant to help it understand your code — but if a particular LSP server is producing noisy or incorrect diagnostics (like missing headers or unknown types for embedded development), you can configure or disable it.
To disable LSP entirely:
{ "lsp": false }To disable a specific LSP server (e.g. clangd which is likely causing your C errors):
{ "lsp": { "clangd": { "disabled": true } } }To keep LSP enabled but configure it, you can pass initialization options or environment variables. For clangd specifically, you might want to configure your compile commands (
compile_commands.json) to fix the missing header errors at the source.For full details:
https://opencode.ai/docs/lsp/
rekram1-node commentedon Jun 23, 2026
Automated: closing question issues.
GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.
If this is a bug or feature request, please open a new issue with the appropriate template.