opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: LSP support for choosing between multiple build directories (c++ / clangd)

Open alcroito opened this issue 3 days ago • 1 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Hi,

C++ projects have one source directory, but they usually have multiple build directories, and the build directories might not be located in the root of the the source directory.

For the LSP (clangd) to give correct information, it needs to be told which build directory to use (in thi.

As far as I can tell, opencode currently just starts up clangd in the source directory, and there is no documented way in opencode to tell it which build directory to use.

It would be great if this was configurable in opencode, without having to fully override / add a new LSP entry config.

Or even better, it if it would be automatically discoverable / adjustable depending on which build dir the LLM created and is using, without having to manually track / modify this as a user.

For clangd, this can be specified either via a command line --compile-commands-dir to the clangd invocation , or via env var

"CLANGD_FLAGS": "--compile-commands-dir=<build_dir>"

alcroito avatar Jan 11 '26 10:01 alcroito