emacs-lsp / lsp-sonarlint

lsp-mode :heart: sonarlint
GNU General Public License v3.0
80 stars 13 forks source link

Allow connecting to a remote Sonarqube instance #9

Open stevenremot opened 3 years ago

stevenremot commented 3 years ago

This is a WIP.

Missing:

This PR adds the custom variables necessary, according to the VSCode extension documentation, to connect sonarlint to a remote Sonarqube instance. However, I can't get it to actually display the issues raised by my sonarqube instance.

The variables in this PR should be used this way if I understand correctly:

  (setq lsp-sonarlint-connections-sonarqube '[((serverUrl . "https://...")
                            (token . "..."))]
          lsp-sonarlint-project '((projectKey . "...")))

I configured lsp-sonarling with my sonarqube instance, and did the same in parallel in VSCode. I enabled the language server I/O logs. I see that the params are sent to the language server, and it does it using the same structure than VSCode. So I'm not sure what's missing here... I still submit the PR in the hope someone has an idea about what I did wrong here... I will gladly close it if this was a bad idea.

Once this PR is finished and merged, this should fix #1

henryju commented 3 years ago

However, I can't get it to actually display the issues raised by my sonarqube instance.

This is not the expected outcome of SonarLint connected mode. SonarLint will still "compute" issues locally. The difference is that in connected mode, it will use the analyzers installed on the server, as well as quality profile (rules + rules parameters) configured for the bound project.

stevenremot commented 3 years ago

This is not the expected outcome of SonarLint connected mode. SonarLint will still "compute" issues locally.

Thanks for the clarification, that part was a bit blurry to me. Does it imply something about the issues I have on the connected mode? I'm still supposed to see the same issues in Sonarqube and in Emacs if I use the right configuration, right?

Sasanidas commented 2 years ago

Thanks for this work @stevenremot !

Can you provide a status of this pull request? :+1:

stevenremot commented 2 years ago

You're welcome! Sadly it didn't advance at all, I can't find why the language server doesn't take the variables into account while they are being sent...