SonarLint plugin not working on VS Code editor | Ubuntu OS

3,095 views
Skip to first unread message

luv.s...@decurtis.com

unread,
May 1, 2018, 3:10:54 AM5/1/18
to SonarLint
Hi all,

I installed sonarlint plugin in webstorm ide and it worked fine. But i am not able to make it work in VSCode.  I am using Ubuntu OS 14.X.X version.

I added the sonarlint extension in vscode and followed the step given on the sonarlint website. But i am not able to see any sonarlint erros highlighted in the source code or the console of VSCode editor. I tried using these JRE paths in sonarlint java configuration:

"sonarlint.ls.javaHome": "/usr/lib/jvm/java-8-openjdk-amd64/jre", and
"sonarlint.ls.javaHome": "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java", Can anyone help me on this?

luv.s...@decurtis.com

unread,
May 1, 2018, 3:11:50 AM5/1/18
to SonarLint
Adding more info to above post of mine. The sourcecode is in javascript. Thanks!

janos....@sonarsource.com

unread,
May 1, 2018, 4:15:47 AM5/1/18
to SonarLint
Hi,

This one looks correct:

  "sonarlint.ls.javaHome": "/usr/lib/jvm/java-8-openjdk-amd64/jre",

The other one is clearly wrong.

Can you please include the output of this command:

    /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -version

When VSCode starts, do you get pop-up messages about errors?

Can you give an example of JavaScript issues that you see highlighted in WebStorm but not in VSCode?

Cheers,
Janos

luv.s...@decurtis.com

unread,
May 1, 2018, 8:19:41 AM5/1/18
to SonarLint
Hi Janos,

Thanks a lot for your prompt response. Yes you are right, the other one is certainly wrong and i just tried it because sonarlint wasn't working at all :( and when i used this wrong jre path, it gave me error popups on when i restarted vscode editor.

When i used the correct jre path -   "sonarlint.ls.javaHome": "/usr/lib/jvm/java-8-openjdk-amd64/jre", i did not get any error pop up on restarting vscode but sonarlint did not work either as i did not see any error highlighted or in the console. For the same source code, i am getting errors by sonarlint in Webstorm IDE. For example: suppose i am passing an object as an argument to a function named "getUser" as shown below:

const name = "Luv Sharma";
getUser({ id: "001", name, type: "social" });  // sonarlint gives me error that shorthand object properties ( "name" here in this case ) should be grouped at the beginning or end of an object declaration.

I am attaching the snapshot of output of this command   /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -version.

Thanks again!

Best,
Luv
Screenshot from 2018-05-01 17-37-15.png

luv.s...@decurtis.com

unread,
May 3, 2018, 5:51:00 AM5/3/18
to SonarLint
Hi Janos, Do you have any update on this. Thanks.

Best,
Luv

Janos Gyerik

unread,
May 3, 2018, 12:21:23 PM5/3/18
to luv.s...@decurtis.com, SonarLint
Hi,

sonarlint gives me error that shorthand object properties ( "name" here in this case ) should be grouped at the beginning or end of an object declaration.

Are you sure that it's SonarLint that gives you that? If yes, then please tell me the rule key of this rule. You can find that in the Rule Description view (double-click on the issue in SonarLint's on-the-fly view).

Thanks,
Janos

--
You received this message because you are subscribed to a topic in the Google Groups "SonarLint" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarlint/fAa6DjsHrRc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/cda05486-672e-4972-9ebf-e69c249fb9ee%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Janos Gyerik | SonarSource

Software Developer

http://sonarsource.com


Are you using SonarLint in your IDE?

Reply all
Reply to author
Forward
0 new messages