SonarLint extenion with latest VSCode not working

Need your help.

Basically, after I upgrade VSCode to the below version, sonarlint extension (latest version 1.9.0) it stopped working. Meaning, it is not showing any warning or error in the editor for TypeScript which used to highlight before.

Also, note that I didn’t change any settings.json parameters from the previous version which includes sonarlint.connectedMode.servers and sonarlint.connectedMode.project parameters. Could you please help me with this.

Version: 1.37.1 (system setup)
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:17:55.855Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

Hi @digidhamu

Have you updated the binding after the update? The format of the local storage has changed and needs to be downloaded again from the server.

If that doesn’t fix your issue, could you please provide:

  • the version of the SonarQube server your are binding to (or tell us if this is SonarCloud)
  • the version of the SonarTS plugin installed on the server (you can easily get this information by opening https://<your SQ server>/api/plugins/installed

Also it would be interesting to look at the SonarLint output, and report any suspicious message (or even the complete output if possible, so that we can see possible issues). On my side I have this when opening a .ts file:

Analysis triggered on file:///home/julien/Prog/Projects/sonarlint/sonarlint-vscode/src/extension.ts with configuration: 
[
  projectKey: org.sonarsource.sonarlint.vscode:sonarlint-vscode
  baseDir: /home/julien/Prog/Projects/sonarlint/sonarlint-vscode
  extraProperties: {}
  inputFiles: [
    file:///home/julien/Prog/Projects/sonarlint/sonarlint-vscode/src/extension.ts (UTF-8) [ts]
  ]
]

Available languages:
[...]
  * TypeScript => "ts"
Start analysis
[...]
Declared extensions of language TypeScript were converted to ts: **/*.ts,**/*.tsx
[Info  - 08:37:13] Index files
Language of file 'file:///home/julien/Prog/Projects/sonarlint/sonarlint-vscode/src/extension.ts' is set to 'ts'
[Info  - 08:37:13] 1 file indexed
Quality profiles:
[...]
  * ts: 'SonarSource TypeScript Conventions' (116 rules)
Setting filesystem encoding: UTF-8
[...]
Execute Sensor: Contextual SonarTS
[Info  - 08:37:15] Started SonarTS Analysis
Initializing metadata of file file:///home/julien/Prog/Projects/sonarlint/sonarlint-vscode/src/extension.ts
[Info  - 08:37:16] Finished SonarTS Analysis
fetchServerIssues projectKey=org.sonarsource.sonarlint.vscode:sonarlint-vscode, fileKey=src/extension.ts
GET 200 https://next.sonarqube.com/sonarqube/batch/issues?key=org.sonarsource.sonarlint.vscode%3Asonarlint-vscode%3Asrc%2Fextension.ts | response time=634ms
Downloaded issues in 753ms

Thanks, @Julien_HENRY for this response.

I have followed your advice as follows

  1. Updated SonarLint bindings successfully
  2. Versions as below

SonarQube Server
Version 6.7.5 (build 38563)

TypeScript Plugin
sonar-typescript-plugin-1.1.0.1079.jar
version: 1.1 (build 1079)

But I need your guidance where to get SonarLint output in Windows + VSCode

Please advise.

Look at Frequently asked questions (search for “How to get SonarLint for VSCode logs?”)

Great @Julien_HENRY.

Here is the SonarLint output from VSCode for your advise.

Analysis triggered on 'file:///d%3A/sol/src/app/app.component.ts with configuration': 
[
  projectKey: sonar-demo
  baseDir: d:\sol
  extraProperties: {}
  inputFiles: [
    'file:///d%3A/sol/src/app/app.component.ts (UTF-8) [ts]'
  ]
]

No language available
[Warn  - 1:33:15 PM] No analyzers installed
Start analysis
[Info  - 1:33:15 PM] Index files
Language of file 'file:///d%3A/sol/src/app/app.component.ts' is set to 'ts'
[Info  - 1:33:15 PM] 1 file indexed
Quality profiles:

The issue is that SonarTS plugin is too old to run in SonarLint. You have to update to 1.5.0.2122 or more recent.

2 Likes