How to configure connected mode in VSCode

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..."
  }
] 

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

Hi @Julien_HENRY, any update on specifying sonarlint.connectedMode.project settings in a folder instead of workspace settings? We work in a poly repo setup and this would make it much easier for our workflow.

Hello @cmachler-sans, thank you for your feedback.

As far as I can tell, pushing down the project settings for connected mode to folder level is one of several UX improvements we want to tackle by the end of this year.

You might have noticed that we recently released SonarLint for VSCode 1.9 with initial support for connected mode in multi-folder workspaces, where all workspace folders are subfolders of one server project.

If I understand correctly, your poly repo setup looks like what we call level 2 support in the aforementioned ticket, a.k.a multiple projects connected to the same server instance; whereas what we delivered with version 1.9 is level 1, a baby step towards level 2.

1 Like

That is correct, it is multiple projects connected to a server instance. Looking forward to level 2 support being added to an already fantastic product.

1 Like

FYI binding at folder level was implemented in version 1.12 (https://jira.sonarsource.com/browse/SLVSCODE-92).

Hello! This is my work setting: