microsoft / vscode-cpptools

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

Code analysis stop working (until Reload Window) if a save is done that fails while code analysis is running (and save shouldn't fail) #12721

Open sean-mcmanus opened 2 days ago

sean-mcmanus commented 2 days ago
  1. Run code analysis on some file.
  2. Make some edit and save to some file that is locked for editing by clang-tidy. You should get a file save failed notification from VS Code.
  3. Cancel code analysis (optional, it should repro the bug even if you wait till it finishes).
  4. Run code analysis again.

Bug: Code analysis never actually runs and is stuck in a running state (internally it's waiting for the save of the file that never arrived). The code expected that a willSaveWaitUntil will always be followed by a save.

sean-mcmanus commented 2 days ago

Oh, looks like the "root" (or 2nd) bug is that the save shouldn't fail and there's a problem canceling the code analysis when the willSaveWaitUntil is called.

sean-mcmanus commented 2 days ago

Doing a successful save while code analysis is running might be a workaround though (not sure yet)...