microsoft / microsoft/vscode-languageserver-node
LanguageClient get stuck in starting state with socket transport kind
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 404
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 14
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided socket-transport example and tracing LanguageClient.start() through the spawned process and connection wait. Check how a nonzero command exit is handled, then verify that start fails instead of remaining in the Starting state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100