mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
allow xtask install --client-code[=CLIENT] to specify client
This commit is contained in:
parent
59483c2176
commit
d0bb051ef7
2 changed files with 49 additions and 15 deletions
|
@ -16,7 +16,7 @@ use xshell::pushd;
|
|||
use xtask::{
|
||||
codegen::{self, Mode},
|
||||
dist::DistCmd,
|
||||
install::{ClientOpt, InstallCmd, Malloc, ServerOpt},
|
||||
install::{InstallCmd, Malloc, ServerOpt},
|
||||
metrics::MetricsCmd,
|
||||
pre_cache::PreCacheCmd,
|
||||
pre_commit, project_root,
|
||||
|
@ -46,10 +46,11 @@ USAGE:
|
|||
cargo xtask install [FLAGS]
|
||||
|
||||
FLAGS:
|
||||
--client-code Install only VS Code plugin
|
||||
--server Install only the language server
|
||||
--mimalloc Use mimalloc for server
|
||||
-h, --help Prints help information
|
||||
--client-code[=CLIENT] Install only VS Code plugin.
|
||||
CLIENT is one of 'code', 'code-insiders', 'codium', or 'code-oss'
|
||||
--server Install only the language server
|
||||
--mimalloc Use mimalloc for server
|
||||
-h, --help Prints help information
|
||||
"
|
||||
);
|
||||
return Ok(());
|
||||
|
@ -67,10 +68,12 @@ FLAGS:
|
|||
let malloc =
|
||||
if args.contains("--mimalloc") { Malloc::Mimalloc } else { Malloc::System };
|
||||
|
||||
let client_opt = args.opt_value_from_str("--client-code")?;
|
||||
|
||||
args.finish()?;
|
||||
|
||||
InstallCmd {
|
||||
client: if server { None } else { Some(ClientOpt::VsCode) },
|
||||
client: if server { None } else { Some(client_opt.unwrap_or_default()) },
|
||||
server: if client_code { None } else { Some(ServerOpt { malloc }) },
|
||||
}
|
||||
.run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue