-
Notifications
You must be signed in to change notification settings - Fork 11
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
.clangd
path incorrectly prefixed with project_name
#373
Comments
I assume that's a bug. Which OS are you using? |
Which C/C++ project type are you using in CDT? Normally you cannot switch build configuration in a CDT Cmake project. |
Ubuntu 24.04, more specifically:
Using Cmake4eclipse. Was pretty sure that was the recommended one here, but reviewing the README, that is not the case. I will try setting up a CDT Cmake project. |
Indeed, the builtin CDT Cmake project doesn't have multiple build configurations. I wasn't able to find a way to trigger the |
When you create new CMake project in CDT (Empty project or Hello World), there should be
As there are no different build configurations for a CMake project, the path would not be changed automatically.
Which behavior do you mean? The automatic setting of the CompilationDatabase path in the I hope this will help you |
Yeah, that's the behavior I mean, but it is indeed a concern specific to using cmake4eclipse. There are a couple of issues like this thread and this other thread, but otherwise the lsp seems to be working well with cmake4eclipse. But understandable if it is not in scope. |
No, I think not really. With an LSP (LanguageServerProtocol) based editor there is IMO no need to use cmake4eclipse any more. Because when I am right, cmake4eclipse is an adapter to provide (mainly) information to the CDT indexer used by editor-, outline-,call/type-hierarchy-view,... With the new editor these information are provided by the Language Server (clangd). |
yes, we've still some work to do. |
Sounds good, will close this then. |
We ran into this issue using CDT-LSP alongside cmake4eclipse too. Our workaround was to pass the compilation database path to the CLI, like |
The disadvantage here is that the |
Given 2 CMake build configurations, let's say
Debug
andRelease
, when switching between them, the extension is modifying the.clangd
file with a new path to account for the build configuration change.However, it seems it defines the path prefixed with the project name like so:
(including the root
/
), but the correct path should be:As such, after switching configurations
clangd
doesn't work correctly. If I manually modify the path in.clangd
to trim the/my_project_name
prefix and restartEclipse
,clangd
is restored to working order again.Is this a bug or is there a misconfiguration on my part?
The text was updated successfully, but these errors were encountered: