When I run “Update Sonarlint binding to SonarQube/Sonarcloud” in my command pallete, after setting everything up, I get a message “sonarlint invalid binding: The specified serverId does not exist”.
The serverId in this context is not what you think. The binding configuration in VSCode is splitted in 2 parts. One part are credentials/global details that are probably the same for all projects of a given user. Those settings should be stored in user settings. For example in my case I have:
And then for every project, you will configure the server + projectKey it should be bound to. Since it is project specific, you should store that at workspace level. Like:
"sonarlint.connectedMode.project": {
"serverId": "sonarcloud", // Connection defined in sonarlint.connectedMode.servers
"projectKey": "sample-ts-henryju" // Project key in SonarQube/SonarCloud
},
You can see that the “serverId” in “sonarlint.connectedMode.project” should match one defined in “sonarlint.connectedMode.servers”. But except from that, you can choose any identifier.