Analysis runs after every edit

Problem description

When I edit a file (e.g., add a new line - even without saving), it triggers a new analysis that runs for a few seconds. This is expected behavior.

If I edit the file again while the analysis is running, it does not cancel the current analysis and start a new one. This also seems reasonable.

However, if I edit the file multiple times during an ongoing analysis, it appears that the analyzer creates a “snapshot” after each edit, adds it to a queue, and processes each snapshot one by one. As a result, a long queue of snapshots is formed, and they are analyzed consecutively for several minutes - even if I don’t touch the keyboard at all. I would expect only the most recent snapshot (i.e., after the last edit) to be analyzed, while the previous ones - now irrelevant - should be discarded.

Is my assumption about the queue correct, or is my analysis simply taking longer than expected? My project consists of just one file with approximately 400 lines of C++23 code, and the analysis takes about 10 seconds.

Environment

  • Operating system: openSUSE Leap 15.6
  • SonarQube for VS Code plugin version: 4.19.0
  • VS Code version: 1.98.2
  • Programming language you’re coding in: C++ (specifically C++23)
  • Is connected mode used: no

Hello @rbedros,

We are working on improvements in that area for a few weeks now, and they should be part of the next release. There are many improvements around analysis scheduling, and the specific case you mentioned is covered. I will ping you when the new version is published

Hello @rbedros,

We have released the improvements mentioned above, could you update to the latest version and see if it helps with the issues you faced?

Thanks!