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

feat(cli): add --stdio argument to lsp-proxy command #1997

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

nhedger
Copy link
Member

@nhedger nhedger commented Mar 7, 2024

Summary

This PR introduces a bogus --stdio argument for the lsp-proxy command.

According to the Implementation Considerations section of the LSP specification, it is recommended that language servers support the --stdio argument if the server communicates over stdio.

The absence of this argument actually makes it harder to spawn Biome's LSP when using vscode-languageclient, because it appends an --stdio argument to the command, and since the lsp-proxy command does not support it, the binary exits with an error.

By introducing this bogus (and hidden) argument, we make it easier to interface with Biome's LSP.

Test Plan

Try spawning Biome's LSP using vscode-languageclient:

new LanguageClient(
	"biome",
	{
		command: bin.fsPath,
		transport: TransportKind.stdio,
		args: ["lsp-proxy"],
	},
	{
		outputChannel: logger,
		traceOutputChannel: window.createOutputChannel(`Biome LSP`, {
			log: true,
		}),
		documentSelector: this.generateDocumentSelector(),
	},
);

@github-actions github-actions bot added the A-CLI Area: CLI label Mar 7, 2024
Copy link

netlify bot commented Mar 7, 2024

Deploy Preview for biomejs canceled.

Name Link
🔨 Latest commit 314dc19
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65ea0a686164c7000898e96f

@nhedger nhedger requested review from a team March 7, 2024 18:43
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@nhedger nhedger merged commit 446b45c into main Mar 7, 2024
18 checks passed
@nhedger nhedger deleted the feat/lsp-proxy-stdio branch March 7, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants