-
Notifications
You must be signed in to change notification settings - Fork 12
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
ClangdCProjectDescriptionListener doesn't respond to build configuration changes of CMake projects #435
Comments
@betamaxbandit: I don't know if CDT LSP should listen to |
Thanks to @jonahgraham for raising this issue. We were initially conversing via email, so I'll paste in here the findings I wrote about. ==
BTW, you can see what the expected build directory name is by expanding the build directory in the project. For each new build configuration a new directory is created (after clicking build in the launch bar). Since eclipse-cdt/cdt#1084, this will never be "default". The name is calculated by https://github.com/eclipse-cdt/cdt/blob/654e27076709ce2b8a9a42fd4acbc6b92bc3442c/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfigurationProvider.java#L93 I'd like to know what the purpose of the .clangd file is. From what I can see, it doesn't seem to be used, but I expect I've missed something. Cheers John |
@jonahgraham , I do know that when the CoreBuildLaunchBarTracker detects that a new build config should be set active, it calls*:
I would have thought calling these two methods would cause the CProjectDescriptionEvent to be fired, but I don't know for sure. |
Sadly not expected: Should https://github.com/eclipse-cdt/cdt/blob/654e27076709ce2b8a9a42fd4acbc6b92bc3442c/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/launch/CoreBuildLaunchBarTracker.java#L247-L248 have an event as a side effect? |
@betamaxbandit and I had a chat about this and listening to resource change events seems best to track the change to the project's active build config. |
I'm working on this - hopefully have something by RC1. |
In eclipse-cdt/cdt#1084 a fix was introduced to stop using "default" as the build folder, which was basically used when CDT couldn't figure out what the user actually asked for.
This change works fine, but it exposed that ClangdConfigurationFileManager is not updating
.clangd
sCompilationDatabase
path when the Core Build (CMake) active config changes. AFAICT This is because theClangdCProjectDescriptionListener
is not listening to sufficient events to see the change.To reproduce (without eclipse-cdt/cdt#1084 applied)
Notice how
.clangd
continues to haveCompilationDatabase: build/default
and that some indexing isn't working@betamaxbandit identified this, so he may be able to provide a more complete description
The text was updated successfully, but these errors were encountered: