Sonarlint for Visual Studio Code is not displaying anything for Java after binding

2.3k Views Asked by At

I am trying to get SonarLint (v2.0.0) configured with VS Code (v1.57.0) connected to a SonarQube server (v8.1). Java Runtime (JRE) 8 is installed on my computer.

I have configured the workspace and user settings in VS Code as below:

User Settings:

{
    "sonarlint.connectedMode.connections.sonarqube": [
        {
            "serverUrl": "https://sonarqube.xxxx.com/",
            "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        
        }   
    ],

    "sonarlint.output.showAnalyzerLogs": true,
    "sonarlint.output.showVerboseLogs": true,

    "sonarlint.ls.javaHome": "C:\\Program Files\\Java\\jdk1.8.0_291",
    "java.home": "C:\\Program Files\\Java\\jdk1.8.0_291"
}

Workspace Settings:

{
    "sonarlint.connectedMode.project": {
        "projectKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
}

Output SonarLint:

[Debug - 21:49:17.115] Queuing analysis of file 'file:///c:/Users/mangobug/workspace/app/SomeResource.java'
[Debug - 21:49:17.119] Cached Java config for file 'file:///c:/Users/mangobug/workspace/app/SomeResource.java'
[Debug - 21:49:17.119] Skipping analysis of Java file 'file:///c:/Users/mangobug/workspace/app/SomeResource.java' because SonarLint was unable to query project configuration (classpath, source level, ...)

I have checked the bindings and everything looks good to me but still java files are skipped. I have gone over multiple solutions online including moving the workspace settings inside the project and adding a 'serverId', adding path to JAVA_HOME to the settings file, forcing the correct JDK is being picked, etc. but none has worked.

0

There are 0 best solutions below