Skip to content
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

updating compile_commands.json cause error message and indexing freezes. #4058

Closed
mdzahidh opened this issue Aug 10, 2019 · 9 comments
Closed
Labels
bug Feature: Compile Commands fixed Check the Milestone for the release in which the fix is or will be available. insiders Currently only repros with our latest Insiders release.
Milestone

Comments

@mdzahidh
Copy link

Describe the bug

  • OS and Version: Linux and Windows
  • VS Code Version: 1.37.0-insider
  • C/C++ Extension Version: 0.25.0-insiders

To Reproduce
When you update compile_commands.json while vscode is running, cpptools gives out error saying ""${workspaceFolder}/compile_commands.json" could not be parsed. 'includePath' from c_cpp_properties.json will be used instead.", sometimes multiple times, and the indexing either takes very long or freezes (the red flame turns on indefinitely), which also freezes all code intellisense.

Expected behavior
cpptools should pick up changes in compile_commands.json after the file has been fully updated and re-indexing shouldn't freeze.

@sean-mcmanus sean-mcmanus added this to the August 2019 milestone Aug 10, 2019
@sean-mcmanus sean-mcmanus added bug Feature: Compile Commands insiders Currently only repros with our latest Insiders release. investigate: repro This issue's repro steps needs to be investigated/confirmed labels Aug 10, 2019
@sean-mcmanus
Copy link
Contributor

This sounds related to the changes #2306 and #3864 .

@mdzahidh
Copy link
Author

While I really want to thank the team for addressing this bug in 0.25.0-insiders, but I think there is still something that's causing issues. Perhaps, cpptools is picking up the changes while the compile_command.json is in the middle of being updated ? For example, our compile_commands.json is fairly large and it takes a little long to write it out.

@mdzahidh
Copy link
Author

Could you repro this on your end ? fixing this would be such a tremendous productivity boost for us

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Aug 13, 2019

I'm not sure if we've reproed it yet -- but the fix might be to just set a timer (like we do with our mac crash file watcher) and/or later switch to using a different file watcher API -- VS Code added a vscode.workspace.fs API with 1.37, but that would require us taking a dependency on that newer version (but that API might have the same issue?).

@sean-mcmanus
Copy link
Contributor

Are you able to check how many seconds it takes for your compile_commands.json to be written? Do you think waiting 5 seconds before processing the change would work? Would possibly delaying the update a few seconds longer than necessary be an issue for you?

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 14, 2019
@sean-mcmanus sean-mcmanus removed their assignment Aug 14, 2019
@sean-mcmanus
Copy link
Contributor

We have a potential fix at #4081 .

@mdzahidh
Copy link
Author

mdzahidh commented Aug 14, 2019

The fix looks great given there is no other event such as "closed" being triggered by the fileWatcher. I checked your branch, and it does seem to resolve the problem. Thanks a lot! can't wait for this to see in a released version.

@sean-mcmanus
Copy link
Contributor

The fix should be in 0.25.0-insiders2: https://github.com/microsoft/vscode-cpptools/releases/tag/0.25.0-insiders2 . Let us know if it doesn't work for you.

@mdzahidh
Copy link
Author

Thanks a lot ! this is working fine now :)

@bobbrow bobbrow removed the investigate: repro This issue's repro steps needs to be investigated/confirmed label Aug 16, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Compile Commands fixed Check the Milestone for the release in which the fix is or will be available. insiders Currently only repros with our latest Insiders release.
Projects
None yet
Development

No branches or pull requests

4 participants