SonarLint for Visual Studio Code support for Go timeline?


(Geoff Baskwill) #1

SonarLint seems to be a great tool, and the integration in Visual Studio Code seems similarly very useful.

Is there a plan to support linting Go code in SonarLint for Visual Studio Code?


(Geoff Baskwill) #2

I’ve looked in JIRA and there doesn’t seem to be any mention of the idea.

Is it as simple as adding a few lines to scripts/prepare.js and src/extension.ts?

(Geoff Baskwill) #3

Looks like no … I’ve made what I think are the required changes to those files and still get: ```
Available languages:

  • PHP => “php”
  • Python => “py”
  • TypeScript => “ts”
  • JavaScript => “js”

(Geoff Baskwill) #4


[Warn - 1:41:02 PM] Code analyzer ‘SonarGo’ is not compatible with SonarLint. Skip loading it.

(Christophe Lévis) #5

Hi Geoff,

Indeed, the Go analyzer is yet not compatible with SonarLint.
Currently, there’s no short-term plan to work on this, but it might come later.

(Geoff Baskwill) #6

Thanks @Chris! How would someone learn what changes would be required to make the Go analyzer compatible with SonarLint? Any idea how big a project that might be?

Are the relevant projects sonarlint-core and sonar-go?

(Tibor Blenessy) #7

Hi @glb

You can have a look at this two PRs I did recently to add support for Kotlin and Ruby

However, the main part of the work is not technical one, but in testing. Also you will need to modify specific SonarLint IDE plugin for which you want to make it work (VSCode, IntelliJ, Atom, Eclipse)

Also just be warned, we are quite busy, so even if you make the contribution I can not guarantee that we will be able to review it and integrate it in timely manner. Of course you can build and use it for yourself locally.

(Geoff Baskwill) #8

Thank you @saberduck! I will definitely take a look at these. I think I’ve got the changes I need for the VSCode extension, the next step seems to be to resolve the Code analyzer 'SonarGo' is not compatible with SonarLint issue. Hopefully these PRs will be enough to get things working enough to try it out.

Thanks very much!

(Tibor Blenessy) #9

@glb I created a ticket to keep track of this request

(Geoff Baskwill) #10

Thanks @saberduck! I wasn’t able to resolve the issues I encountered trying to do this myself so I gave up (temporarily?) … am definitely looking forward to seeing go support happen.