From 314dc19aa86007ed68429ae6ce98771d7acd5816 Mon Sep 17 00:00:00 2001 From: Nicolas Hedger Date: Thu, 7 Mar 2024 19:31:54 +0100 Subject: [PATCH] feat(cli): add `--stdio` argument to `lsp-proxy` command --- crates/biome_cli/src/commands/mod.rs | 13 ++++++++----- crates/biome_cli/src/lib.rs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/biome_cli/src/commands/mod.rs b/crates/biome_cli/src/commands/mod.rs index 17e5c5c4a0b5..ca8276474d11 100644 --- a/crates/biome_cli/src/commands/mod.rs +++ b/crates/biome_cli/src/commands/mod.rs @@ -259,6 +259,9 @@ pub enum BiomeCommand { /// Allows to set a custom path when discovering the configuration file `biome.json` #[bpaf(env("BIOME_CONFIG_PATH"), long("config-path"), argument("PATH"))] Option, + /// Bogus argument to make the command work with vscode-languageclient + #[bpaf(long("stdio"), hide, hide_usage, switch)] + bool, ), /// It updates the configuration when there are breaking changes #[bpaf(command)] @@ -327,7 +330,7 @@ impl BiomeCommand { | BiomeCommand::Ci { cli_options, .. } | BiomeCommand::Format { cli_options, .. } | BiomeCommand::Migrate { cli_options, .. } => cli_options.colors.as_ref(), - BiomeCommand::LspProxy(_) + BiomeCommand::LspProxy(_, _) | BiomeCommand::Start(_) | BiomeCommand::Stop | BiomeCommand::Init(_) @@ -350,7 +353,7 @@ impl BiomeCommand { | BiomeCommand::Start(_) | BiomeCommand::Stop | BiomeCommand::Explain { .. } - | BiomeCommand::LspProxy(_) + | BiomeCommand::LspProxy(_, _) | BiomeCommand::RunServer { .. } | BiomeCommand::PrintSocket => false, } @@ -373,7 +376,7 @@ impl BiomeCommand { | BiomeCommand::Stop | BiomeCommand::Init(_) | BiomeCommand::Explain { .. } - | BiomeCommand::LspProxy(_) + | BiomeCommand::LspProxy(_, _) | BiomeCommand::RunServer { .. } | BiomeCommand::PrintSocket => false, } @@ -387,7 +390,7 @@ impl BiomeCommand { | BiomeCommand::Ci { cli_options, .. } | BiomeCommand::Migrate { cli_options, .. } => cli_options.log_level.clone(), BiomeCommand::Version(_) - | BiomeCommand::LspProxy(_) + | BiomeCommand::LspProxy(_, _) | BiomeCommand::Rage(..) | BiomeCommand::Start(_) | BiomeCommand::Stop @@ -406,7 +409,7 @@ impl BiomeCommand { | BiomeCommand::Migrate { cli_options, .. } => cli_options.log_kind.clone(), BiomeCommand::Version(_) | BiomeCommand::Rage(..) - | BiomeCommand::LspProxy(_) + | BiomeCommand::LspProxy(_, _) | BiomeCommand::Start(_) | BiomeCommand::Stop | BiomeCommand::Init(_) diff --git a/crates/biome_cli/src/lib.rs b/crates/biome_cli/src/lib.rs index c1034657573c..f73e4c0aa2dc 100644 --- a/crates/biome_cli/src/lib.rs +++ b/crates/biome_cli/src/lib.rs @@ -188,7 +188,7 @@ impl<'app> CliSession<'app> { ), BiomeCommand::Explain { doc } => commands::explain::explain(self, doc), BiomeCommand::Init(emit_jsonc) => commands::init::init(self, emit_jsonc), - BiomeCommand::LspProxy(config_path) => commands::daemon::lsp_proxy(config_path), + BiomeCommand::LspProxy(config_path, _) => commands::daemon::lsp_proxy(config_path), BiomeCommand::Migrate { cli_options, write,