I’m new to using sonarlint and wanted to use it for a java project.
I enabled the vscode plugin (not in connected mode) and I noticed the following:
Some of the errors found by sonarlint show up in the “Problems” tab of vscode while others (I assume lower level ones, like info) don’t (they only show as near invisible wavey lines under the code).
Is there a way to show all found problems in the problem tab?
One rule for example that behaves like this is java:s5786:
The problems filter settings are at default:
Hello, welcome to the community! And thank you for your question.
The problems view is populated by VSCode according to the diagnostics reported by SonarLint’s Language Server. Due to differences between the SonarLint rule severity levels and the diagnostic levels allowed by the Language Server Protocol we chose to map:
- BLOCKER and CRITICAL to Error (red squiggle, same level as compilation errors)
- MAJOR to Warning (yellow squiggle, same level as most linters)
- MINOR to Info (blue squiggle, lowest level visible in the problems view)
- INFO to Hint (lowest visibility, slight underline only)
The rationale behind this mapping is explained in SonarQube’s documentation: a SonarLint “INFO” level issue is “just a finding” (and we adopted a similar approach in SonarLint for Eclipse).
FYI, this mapping was briefly discussed last year in another thread and our position has not changed - though we might reconsider if we get strong arguments to e.g lump INFO with MINOR, or allow a user-configured mapping of issue severity to diagnostic levels.