How to configure connected mode in VSCode

vscode
(Shiming Liu) #1

hi @janos, @Julien_HENRY in vscode sonarlint setting, if I only config server connect field, but not specific project, is it ok?

And for the server config, where to get the serverId,organizationKey and token?

"sonarlint.connectedMode.servers": [
  {
    "serverId": "my_orga_in_sonarcloud.io",
    "serverUrl": "http://192.168.10.239:9010",
    "organizationKey": "my_organization",
    "token": "V2VkIE1..."
  }
] 
VSCode - Is there any example how to configure vscode with sonar server?
Get sonarlint set up in intellij, eclipse & vscode
(Julien Henry) #2

You have to configure both sonarlint.connectedMode.servers and sonarlint.connectedMode.project. We have split binding configuration in two properties to allow to safely store token in user settings, while project key is better in workspace (or soon to be supported folder) settings.

  • serverId is just a random identifier you can choose to link between the two properties (especially useful if you bind to different servers).
  • organization should be left blank for SonarQube, this is only a SonarCloud concept
  • token can be generated in SonarQube in your user security page