-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Reduce amount of (un-needed) changed compile_commands.json events #12919
Conversation
…e flag for failed providers
I think you can fix most of the linter errors by running the formatter. Also, can you use sentence-style comments (starting with a capital letter and ending with a period)? We had one team member check in a bunch of util code that did not use sentence-style comments, but otherwise, I think most of our comments are sentence-styled. It sounds like this PR doesn't need any cpptools-side changes? |
@sean-mcmanus Hi, thanks for the review!
|
@sean-mcmanus Added handling of the main scenario this merge request is removing: |
Is the primary issue the change is intended to address really an issue? The current implementation does not result in unnecessary loading or processing of That said, some feedback on code changes: Updating It's necessary to check Could you perhaps extract the 'file watcher leak' fix into a separate PR? |
@Colengms Thanks for the detailed explanation! It's kinda hard to dig deep on something when only a part of the code is open source. Yes, I can start a PR on the leak. What about the 2nd scenario described? It's definitely a stretch to produce that edge case, but still technically can happen. Addressing it would mean keeping a timestamp per file instead of a single one (as used today). I'm referring to Insights are greatly appreciated. |
closes #12889
Continuing on the discussion in #12911
compile_commands.json
file pointed by the current configuration.compile_commands.json
path to keep track when we last notified on it's change.compile_commands.json
file (both byfs.watcher
and periodically) if a Configuration Provider is set, until we are notified that some file cannot be provided by that provider.CMakeLists.txt
and we use theCMake Tools
as the provider.compile_commands.json
file watcher is inactive.compile_commands.json
doesn't exist.Fixes that are byproducts of this PR:
checkCompileCommands()
leaks open file watchers if thecompileCommands
file is deleted.checkCompileCommands()
only monitoring the current configuration'scompile_commands.json
with a single timestamp, we will not detect changes to acompile_commands.json
on the following scenario:compile_commands.json
.y
throwed an error. (for example if hit theinotify
limit on Linux).y
has changed while we were using configurationx
.