can't get SonarLint to work in Atom or VS Code

721 views
Skip to first unread message

metasean

unread,
Oct 12, 2017, 12:16:44 PM10/12/17
to SonarLint
Our team is currently exploring SonarLint.  As part of this, we're trying to get everything installed and running, but I'm having no success in getting it running in either Atom (my daily editor) or VS Code (using it just to see if this problem was Atom-specific or not).

I have been able to get SonarLint for Command Line installed and running successfully, but so far I haven't been able to get SonarLint for Atom or SonarLint for VS Code to run.

Because I'm on a really new system, I had installed the latest JDK which is v9.  Since the documentation for both indicates JRE 8 is required, I've dual installed them.  SonarLint for Command Line works fine with both, so I'd assume the Atom and Code versions would also.  At the moment, my bash profile includes:
## Java
# export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

## SonarLint for the Command Line
export PATH=${PATH}:/Applications/sonarlint-cli-2.1.0.566/bin




For my Atom config.cson and settings.json (VS Code) I've tried:

the default (i.e. not explicitly set)

and I've tried

Atom:
  sonarlint:
    javaHome
: "/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home"

VS Code
{
 
"sonarlint.ls.javaHome": "/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home"
}



and I've tried

Atom:
  sonarlint:
    javaHome
: "/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home"

VS Code
{
 
"sonarlint.ls.javaHome": "/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home"
}

and I've tried

Atom
  sonarlint:
    javaHome
: "/System/Library/Frameworks/JavaVM.framework/Home"

VS Code
{
 
"sonarlint.ls.javaHome": "/System/Library/Frameworks/JavaVM.framework/Home"
}




My linter is definitely working (i.e. I'm getting basic linter errors), and since I'm using the same file that I used to verify the command line SonarLint, I know that works.

What else do I need to check to get SonarLint working in my Atom?

metasean

unread,
Oct 12, 2017, 2:55:57 PM10/12/17
to SonarLint
I made a hint of progress, but now I'm well and truly stuck trying to get the Atom package to work!

Specifically, I had named my test file sonarlinter-test.js, when I renamed it to sonarlinter-triggers.js, the VS Code problems panel lit up with sonarlint errors and warnings -which would rock if VS Code was my day-to-day editor, but it isn't.

The one good and bad thing from this is that I'm getting sonarlint feedback from test file in both the CLI and VS Code.

Unfortunately, I'm still not getting any sonarlint feedback in Atom, neither the expected sonarlint warnings and errors nor feedback that would indicate configuration errors!

I've completely uninstalled the sonarlint package in Atom, reinstalled it, and worked my way through the different JDK/JRE configs (quitting & restarting Atom after each change) - all to no avail.

Does anyone have any suggestions on how I can get more information, suggestions on troubleshooting, things I should check/verify, etc so that I can get sonarlint working in atom?

metasean

unread,
Oct 13, 2017, 10:45:36 AM10/13/17
to SonarLint
Does anyone have any suggestions for troubleshooting an Atom plugin failure?

The console doesn't have any relevant information, and there aren't any installation errors, but I'm also not getting any SonarLint notifications, when I should be. 

thibaul...@gmail.com

unread,
Nov 24, 2017, 8:28:59 AM11/24/17
to SonarLint
I'm stuck at the same point. Did you achieve any progress on this ? 

metasean

unread,
Nov 26, 2017, 11:51:29 PM11/26/17
to SonarLint
Unfortunately not, and as you can see, no one provided any assistance here.  If you're able to get it working, I'd love to know how so that I can re-evaluate SonarLint.

Julien HENRY

unread,
Nov 27, 2017, 3:11:56 AM11/27/17
to metasean, SonarLint
Hi,

Just to eliminate this case, there is a file pattern that will help SonarLint to decide if a file is a unit test or a production code:

There are very few (to not say no) rules applicable to unit tests. So if you name your file sonarlinter-test.js, it may explain why you don't see any issue on it.

++

Julien Henry | SonarSource

Developer

https://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/b5e61331-0c83-4038-8287-a08ed69acf8f%40googlegroups.com.

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

Sean Duncan

unread,
Nov 27, 2017, 9:46:11 AM11/27/17
to Julien HENRY, SonarLint
Hey Julien,

Having test in the filename was definitely part of my original problem.  As I mentioned in my Oct 12th email, renaming it resolved the problem for the CLI and VS Code, but not for Atom. 

I definitely prefer Atom (to the point that after confirming sonarlint worked in VS Code, I deleted VS Code from my system). 

Unfortunately, since SonarLint's CLI only gives me the categorical count of errors and I was never able to get it to work in Atom, I'm simply not using it. 

SonarLint seems like it could be really useful, so I'm still open to troubleshooting suggestions for getting it to work in Atom.

~sean

---

Livin' the dream - livin', learnin', & codin' every day!
 

Reply all
Reply to author
Forward
0 new messages