microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

ChangeCompileCommandsNotification is sent/processed even if a configuration provider is used instead of compile commands #12889

Closed sean-mcmanus closed 1 week ago

sean-mcmanus commented 3 weeks ago

It seems like it should only be sent/processed if compile commands is actually being used for configuration.

sean-mcmanus commented 2 weeks ago

If compileCommands is set, then it could still be used as a fallback if the configuration provider doesn't have a configuration for a file, but if compileCommands is not set then there's no need to send an update for one.

Colengms commented 1 week ago

I don't think these notifications cause a perf issue. They simply result in a dirty flag being set on the native side, causing the compile_commands.json to be re-parsed the next time its contents are required.

It would be nice to avoid sending redundant notifications, but I think that might need to be part of a more wholistic change, to ensure changes are properly synchronized with TU creation.

We have some work (currently on the back burner) to address https://github.com/microsoft/vscode-cpptools/issues/6931 , which may result in the current compile_commands.json handling being replaced (processed entirely on the TypeSide side).