Shared VS Code connected-mode configuration modifies tracked .vscode/settings.json

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-sonarqube
  • sonarqube-prod
  • my-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

  1. Track .vscode/settings.json with shared workspace settings.
  2. Commit .sonarlint/connectedMode.json.
  3. Open the repository in VS Code.
  4. Accept the shared SonarQube binding.
  5. Create or select a locally named connection.
  6. 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.