Problem Description
Currently, the SonarLint Language Server (LSP) starts an embedded HTTP server to enable the “Open in IDE” feature from the SonarQube/SonarCloud interface. This server attempts to bind to a fixed range of ports: 64120 to 64130.
While this works perfectly for local development, it creates a significant bottleneck in shared remote development environments (e.g., a large Linux server accessed via VS Code Remote-SSH, or shared development VMs).
In scenarios where more than 11 developers are working on the same host simultaneously, the port range is exhausted. Subsequent users cannot start the embedded server, effectively breaking the “Open in IDE” functionality for a large portion of the team.
Technical Context
The limitation is hardcoded in the EmbeddedServer.java file within the sonarlint-core backend:
-
File:
org.sonarsource.sonarlint.core.embedded.server.EmbeddedServer -
Constants:
STARTING_PORT = 64120andENDING_PORT = 64130
Proposed Solution
I propose making this port range configurable rather than hardcoded. This would allow system administrators or developers to define a wider range or a specific offset for their environment.
I suggest providing configuration through one of the following methods (in order of preference):
-
VS Code Settings: A new setting like
sonarlint.embeddedServer.portRange(e.g.,"64120-64200"). -
Environment Variables: Support for
SONARLINT_SERVER_PORT_STARTandSONARLINT_SERVER_PORT_END. -
System Properties: Allowing a
-Dsonarlint.server.ports=...flag.
Impact
-
Improved Scalability: Supports large teams working on centralized development infrastructure.
-
Flexibility: Avoids conflicts with other services that might be camping on those specific ports in restricted corporate networks.
-
Consistency: Ensures the “Open in IDE” feature remains reliable regardless of the number of concurrent users on a host.