How to configure LSP? #4470

Open
opened 2026-02-16 17:43:52 -05:00 by yindo · 2 comments
Owner

Originally created by @Suaig on GitHub (Jan 8, 2026).

Originally assigned to: @jayair on GitHub.

Question

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?

Originally created by @Suaig on GitHub (Jan 8, 2026). Originally assigned to: @jayair on GitHub. ### Question 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?
yindo added the docs label 2026-02-16 17:43:52 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 8, 2026):

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

  • #2536: Discusses disabling LSP or running it at session end only, addressing concerns about LSP being too aggressive and noisy
  • #711: Another question about LSP configuration and usage
  • #7227: Feature request to disable LSP for external directories, which relates to controlling LSP behavior

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

@github-actions[bot] commented on GitHub (Jan 8, 2026): This issue might be a duplicate of existing issues. Please check: - #2536: Discusses disabling LSP or running it at session end only, addressing concerns about LSP being too aggressive and noisy - #711: Another question about LSP configuration and usage - #7227: Feature request to disable LSP for external directories, which relates to controlling LSP behavior Feel free to ignore if none of these address your specific case.
Author
Owner

@zbynekwinkler commented on GitHub (Jan 12, 2026):

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

CompileFlags:
  CompilationDatabase: build/Debug

and I've finally fixed this issue for myself. For reference see https://clangd.llvm.org/config.html#compilationdatabase

@zbynekwinkler commented on GitHub (Jan 12, 2026): 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 ```yaml CompileFlags: CompilationDatabase: build/Debug ``` and I've finally fixed this issue for myself. For reference see https://clangd.llvm.org/config.html#compilationdatabase
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4470