1 #![allow(unreachable_pub)]
3 use crate::install::{ClientOpt, Malloc, ServerOpt};
8 /// Run custom build command.
11 /// Install rust-analyzer server or editor plugin.
13 /// Install only VS Code plugin.
15 /// One of 'code', 'code-exploration', 'code-insiders', 'codium', or 'code-oss'.
16 optional --code-bin name: String
18 /// Install only the language server.
20 /// Use mimalloc allocator for server
22 /// Use jemalloc allocator for server
35 optional --client-patch-version version: String
40 /// Builds a benchmark version of rust-analyzer and puts it into `./target`.
42 required suffix: String
48 // The following code is generated by `xflags` macro.
49 // Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
52 pub subcommand: XtaskCmd,
69 pub code_bin: Option<String>,
90 pub client_patch_version: Option<String>,
105 pub fn from_env_or_exit() -> Self {
106 Self::from_env_or_exit_()
110 pub fn from_env() -> xflags::Result<Self> {
115 pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
116 Self::from_vec_(args)
122 pub(crate) fn server(&self) -> Option<ServerOpt> {
123 if self.client && !self.server {
126 let malloc = if self.mimalloc {
128 } else if self.jemalloc {
133 Some(ServerOpt { malloc })
135 pub(crate) fn client(&self) -> Option<ClientOpt> {
136 if !self.client && self.server {
139 Some(ClientOpt { code_bin: self.code_bin.clone() })