Visual Studio version: Visual Studio 2026 (18.8.2)
SonarQube for Visual Studio plugin version: 10.6.0.17068
Programming language you’re coding in: C++23
Is connected mode used: yes, SonarQube Cloud
And a thorough description of the problem / question:
Suppressing of issues is possible with // NOSONAR to suppress all issues in a line.
For C# it is possible to suppress Sonar issues in source per line dependening on the issue type.
Unfortunately, there is no such solution as far as I know for C++.
The idea of sonar-resolve is fine, but this does not suppress the issue in the IDE.
Would it be possible to extend SonarLint to suppress issues depending on the rule for C++?
Motivation:
On passing callbacks from C# to C++, function pointers are used which are indicated as cpp:S5205.
sonar-resolve is evaluated server-side during analysis, not locally in the IDE. That means after adding the comment, SonarQube for Visual Studio will still show the issue until the next scan runs and syncs the resolved status back via Connected Mode. It’s not the real-time experience you’d expect from a C#-style #pragma warning disable.
This is a known gap we’re tracking internally, making sonar-resolve directives recognized locally in the IDE, so the suppression takes effect without waiting for a server scan cycle, is on our roadmap.
In the meantime, sonar-resolve is the closest mechanism available for per-rule C++ suppression and avoids the “blind spot” risk of //NOSONAR suppressing unrelated issues in the future.
Hope that helps clarify things. I’ve noted your feedback and will share it with the relevant team.