Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LanguageClient get stuck in starting state with socket transport kind #1586

Open
SciCed opened this issue Nov 13, 2024 · 0 comments
Open

LanguageClient get stuck in starting state with socket transport kind #1586

SciCed opened this issue Nov 13, 2024 · 0 comments
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@SciCed
Copy link

SciCed commented Nov 13, 2024

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.

@dbaeumer dbaeumer added the bug Issue identified by VS Code Team member as probable bug label Nov 15, 2024
@dbaeumer dbaeumer added this to the On Deck milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants