I'm writing an LSP extension that uses socket transport kind.
When the command in the server option exits with a nonnull code, the LanguageClient gets stuck in start().
const serverOptions = {
"command": "node",
"args": ["-e", "process.exit(42)"],
transport: {
kind: TransportKind.socket,
port: 8080
}
}
const clientOptions = {}
lspClient = new LanguageClient(
"MylanguageServer",
"My Language Server",
serverOptions,
clientOptions
);
lspClient.onDidChangeState((state) => {
const states = ["Stopped", "Running", "Starting"];
console.log(`State change from ${states[state.oldState-1]} to ${states[state.newState-1]}`)
})
lspClient.start();
I expect that the start fails if the command fails.
I tried to investigate. The start() seems to be waiting for a connection before registering on the exit event of the spawned process.
I'm writing an LSP extension that uses socket transport kind.
When the command in the server option exits with a nonnull code, the LanguageClient gets stuck in
start().I expect that the start fails if the command fails.
I tried to investigate. The
start()seems to be waiting for a connection before registering on theexitevent of the spawned process.