You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
startAndConnect(port, commandLine): LSP4IJ starts the server, which listens on the port. This is how our DAP support connects today.
startAndAccept(port, commandLine): LSP4IJ listens and starts the server, which connects back. This is VS Code's socket transport (--socket=<port>), which servers built on vscode-languageserver expect, so it's the mode most socket-capable servers need.
A port of 0 picks a free port, and the command line is built for it. The server's output goes to the LSP console log. If the connection or the process ends, that goes through the existing unexpected-stop handling.
Next, I'd do the user-defined part you described as a second PR:
a transport choice in the server tab (stdio / connect to host:port / start and connect / start and accept);
host and port fields, with a free-port option;
${port} in the command line, as in DAP;
template support.
Does that split work for you? Also, should the free-port and readiness code be shared between DAP and LSP, or kept separate for now?
Update: I folded both parts into #1870, so it now covers the whole issue. It has the SocketStreamConnectionProvider for plugin developers, plus the user-defined part you described: a Transport field in the Server tab with host and port, ${port} in the command with 0 for a free port, and a "socket" object in templates. The socket modes are marked experimental. The screenshots are in the PR description. The DAP/LSP sharing question above still stands: for now, the provider has its own small readiness retry, and like DAP it takes free ports from NetUtils.findAvailableSocketPort.
Activity
angelozerr commentedon Nov 4, 2026
@muescha @lagergren @d-biehl are you interested to work on this issue?
The main idea is to implement a new StreamwConnectionProvider and for user defined add a port UI which can be set or generated by getting free port.
lagergren commentedon Nov 5, 2026
@angelozerr I'm happy to take this one. The first part is up as #1870: a
SocketStreamConnectionProviderfor plugin developers.While looking at it, I found that language servers take a socket connection in three ways, so the provider covers all three:
connectTo(host, port): the server already runs and listens, as in a debugger (Add ability to connect via network (ip:port) #658) or inside another application.startAndConnect(port, commandLine): LSP4IJ starts the server, which listens on the port. This is how our DAP support connects today.startAndAccept(port, commandLine): LSP4IJ listens and starts the server, which connects back. This is VS Code's socket transport (--socket=<port>), which servers built onvscode-languageserverexpect, so it's the mode most socket-capable servers need.A port of 0 picks a free port, and the command line is built for it. The server's output goes to the LSP console log. If the connection or the process ends, that goes through the existing unexpected-stop handling.
Next, I'd do the user-defined part you described as a second PR:
${port}in the command line, as in DAP;Does that split work for you? Also, should the free-port and readiness code be shared between DAP and LSP, or kept separate for now?
feat: reach a user-defined language server over a socket
lagergren commentedon Nov 5, 2026
Update: I folded both parts into #1870, so it now covers the whole issue. It has the
SocketStreamConnectionProviderfor plugin developers, plus the user-defined part you described: aTransportfield in the Server tab with host and port,${port}in the command with 0 for a free port, and a"socket"object in templates. The socket modes are marked experimental. The screenshots are in the PR description. The DAP/LSP sharing question above still stands: for now, the provider has its own small readiness retry, and like DAP it takes free ports fromNetUtils.findAvailableSocketPort.feat: reach a language server over a socket (experimental) (#1870)