Skip to content

Stop creating .clangd file per Eclipse project if the compile_commands.json is in a parent folder #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
travkin79 opened this issue Apr 15, 2025 · 2 comments · May be fixed by #491
Open
Assignees

Comments

@travkin79
Copy link
Contributor

This is a follow-up to issue #227, since the problem now arises again (since CDT LSP vers. 3.0 or 3.1).

Issue description
We have the following set-up: There is one common root folder that contains numerous sub-directories with C/C++ Eclipse projects. The root folder contains the compile_commands.json (the compilation database) for all the projects. CDT LSP creates a .clangd file with wrong settings for each of these C/C++ projects and corrupts our clangd configuration.

In CDT LSP versions prior to vers. 3 this issue was already fixed. CDT LSP did find the compile_commands.json in one of a project's parent folder and used that. But now, the issue appears again.

It would be great if the issue could fixed without forcing the users to implement Eclipse plug-ins for customizing CDT LSP, since our set-up (root directory with a compile_commands.json and multiple projects in sub-directories using the same compile_commands.json) seems to be quite common. In addition, in order to avoid regressions in upcoming CDT LSP versions, automated tests should ensure that no .clangd file is created in such cases.

Additional, likely related issues:
#252 #436

@ghentschke
Copy link
Contributor

Sorry for breaking that. I'll take a look at it.

@ghentschke
Copy link
Contributor

Should the .clangd file in the parent folder or project being updated or not?

@ghentschke ghentschke self-assigned this Apr 18, 2025
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue Apr 18, 2025
...folder/s. If a .clangd file exists in the given project, it will be
updated. Otherwise parent folders until root will be searched for a
.clangd file. Its implemented in the
DefaultClangdCompilationDatabaseProvider to allow vendors to overwrite
this behavior if needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants