SonarLint not respecting issues resolved in the UI on a branch

Please provide

  • Operating system: Windows
  • Visual Studio 2022 17.2.2
  • SonarLint plugin version:
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube 9.5

I am working on a feature branch and manually pushed analysis results for this branch to SonarQube
SonarQube reports some issues which I have marked in the UI as resolved/won’t fix
SonarLint continues to report them - it feels like it might be reporting these issues from the master (default) branch and not the branch I am working on.

Hey there.

SonarLint for Visual Studio is not branch-aware like SonarLint for Eclipse, IntelliJ, and VS Code are (this is a very recent addition). We plan on adding branch awareness to SonarLint for Visual Studio in the future, but for now it will only reflect your main branch.

Hi @Colin

Thanks for the quick response.
What would current guidance for VS users be?
Would it be along the lines of:

  • Anything you are going to resolve in the Sonar UI, do it in the master branch and NOT your PR/feature branch?
  • Anything you are going to resolve in code, do it in your branch

Is that fair or is there more/less?

Also when you do add the feature, will it mean that I can resolve an issue through the Sonar UI on my feature branch and, once the branch is merged back to master, those resolutions will come with it?

I am thinking for example where you resolve something as “Won’t fix” because it is legit in this case or mark as a false positive etc.