SonarLint plugin version:
- Vs code: v4.12.0
- Intellij: 10.12.0.79769
Programming language you’re coding in: Java
Is connected mode used:
Connected to SonarQube (and which version): SonarQube Developer Edition v10.7
And a thorough description of the problem / question:
I use both IDEs, Intellij and VS Code, I connect them to the same project in the same SonarQube, however in Intellij I noticed that it gives me a problem that does not appear in VS Code, the problem “java:S6204”.
I checked the rules to see if they were disabled, however in both IDEs the rules are the same and are enabled. I am using Java 17 for both IDEs.
Could this be a problem in Vs Code?
Thanks for reporting this. I was able to reproduce the issue and I freaked out for a minute Until I remembered I’d recently reset my whole VS Code setup along with all the extensions.
In fact, for Java analysis to work properly in SonarQube for VS Code (yes, we have a new name ), you need to have the Language Support for Java(TM) by Red Hat installed. This is highlighted in our docs.
Installing the extension fixed the issue for me, and I hope it does the same for you, too.
Unfortunately, even with the installation of Language Support for Java™ from Red Hat and starting in standard mode, VS Code did not validate this part of the code.
I made an example for you to see, on the left VS Code and on the right Intellij
Some things are validated by Sonarlint on VS Code, such as the “class name” and “system.out”, but not the “collect”. Could it be some configuration of this extension that you sent me?
I tested on two different versions of Language Support for Java™ by Red Hat: v1.36.0 and v1.37.2024112108 (pre-release)