Environment
- SonarQube for IDE version: 6.0.0
- VS Code Insiders: 1.140.0-insider
- Shared binding:
.sonarlint/connectedMode.json
Problem
The extension correctly uses the shared binding from .sonarlint/connectedMode.json, but it also writes this to the tracked .vscode/settings.json:
"sonarlint.connectedMode.project": {
"connectionId": "<arbitrary-name>",
"projectKey": "<project-key>"
}
The connectionId is the arbitrary name chosen locally by each developer when creating their connection. It is a personal choice, not shared connection metadata.
Different developers can use different names for the same SonarQube server, for example:
company-sonarqubesonarqube-prodmy-connection
Therefore, this setting cannot be reliably shared. If one developer commits it, other developers may not have a local connection with that name.
This is also difficult to avoid when .vscode/settings.json is already tracked for legitimate team-wide workspace settings. Git cannot ignore only the SonarQube property within the file.
Expected behavior
Developer-specific connection names should be stored in VS Code or extension-local storage.
Only stable, team-wide binding information should be stored in .sonarlint/connectedMode.json.
Using shared connected-mode configuration should not modify the tracked .vscode/settings.json.
Steps to reproduce
- Track
.vscode/settings.jsonwith shared workspace settings. - Commit
.sonarlint/connectedMode.json. - Open the repository in VS Code.
- Accept the shared SonarQube binding.
- Create or select a locally named connection.
- Run
git diff -- .vscode/settings.json.
The diff contains the developer-specific connectionId.
Suggested solution
Store the mapping to the developer’s locally named connection in VS Code workspace storage or extension storage, rather than .vscode/settings.json.