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
41 optional --client version: String
46 /// Builds a benchmark version of rust-analyzer and puts it into `./target`.
48 required suffix: String
54 // The following code is generated by `xflags` macro.
55 // Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
58 pub subcommand: XtaskCmd,
82 pub code_bin: Option<String>,
110 pub client: Option<String>,
124 pub const HELP: &'static str = Self::HELP_;
126 pub fn from_env() -> xflags::Result<Self> {
133 pub(crate) fn server(&self) -> Option<ServerOpt> {
134 if self.client && !self.server {
137 let malloc = if self.mimalloc {
139 } else if self.jemalloc {
144 Some(ServerOpt { malloc })
146 pub(crate) fn client(&self) -> Option<ClientOpt> {
147 if !self.client && self.server {
150 Some(ClientOpt { code_bin: self.code_bin.clone() })