1 #![allow(unreachable_pub)]
3 use crate::install::{ClientOpt, Malloc, ServerOpt};
8 /// Run custom build command.
11 /// Print help information.
15 /// Install rust-analyzer server or editor plugin.
17 /// Install only VS Code plugin.
19 /// One of 'code', 'code-exploration', 'code-insiders', 'codium', or 'code-oss'.
20 optional --code-bin name: String
22 /// Install only the language server.
24 /// Use mimalloc allocator for server
26 /// Use jemalloc allocator for server
39 optional --client-patch-version version: String
44 /// Builds a benchmark version of rust-analyzer and puts it into `./target`.
46 required suffix: String
52 // The following code is generated by `xflags` macro.
53 // Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
56 pub subcommand: XtaskCmd,
79 pub code_bin: Option<String>,
100 pub client_patch_version: Option<String>,
114 pub const HELP: &'static str = Self::HELP_;
117 pub fn from_env() -> xflags::Result<Self> {
122 pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
123 Self::from_vec_(args)
129 pub(crate) fn server(&self) -> Option<ServerOpt> {
130 if self.client && !self.server {
133 let malloc = if self.mimalloc {
135 } else if self.jemalloc {
140 Some(ServerOpt { malloc })
142 pub(crate) fn client(&self) -> Option<ClientOpt> {
143 if !self.client && self.server {
146 Some(ClientOpt { code_bin: self.code_bin.clone() })