Skip to content

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

Closed as not planned

Description

@alcroito

Feature hasn't been suggested before.

  • 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.

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>"

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 11, 2026
  2. github-actions commented on Jan 11, 2026

    @github-actions
    Contributor

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

    These issues all relate to improving LSP configurability and environment handling. You might find solutions or discussion in these related issues that could help with your specific clangd build directory configuration needs.

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

  3. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. alcroito commented on Mar 25, 2026

    @alcroito
    Author

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

    Are you sure you want me to create a new issue with the exact same description?
    There hasn't been any feedback on this one at all.

  5. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions