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
37 /// Read a changelog AsciiDoc file and update the GitHub Releases entry in Markdown.
38 cmd publish-release-notes {
39 /// Only run conversion and show the result.
41 /// Target changelog file.
42 required changelog: String
47 /// Builds a benchmark version of rust-analyzer and puts it into `./target`.
49 required suffix: String
55 // The following code is generated by `xflags` macro.
56 // Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
59 pub subcommand: XtaskCmd,
69 PublishReleaseNotes(PublishReleaseNotes),
77 pub code_bin: Option<String>,
98 pub client_patch_version: Option<String>,
102 pub struct PublishReleaseNotes {
103 pub changelog: String,
120 pub fn from_env_or_exit() -> Self {
121 Self::from_env_or_exit_()
125 pub fn from_env() -> xflags::Result<Self> {
130 pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
131 Self::from_vec_(args)
137 pub(crate) fn server(&self) -> Option<ServerOpt> {
138 if self.client && !self.server {
141 let malloc = if self.mimalloc {
143 } else if self.jemalloc {
148 Some(ServerOpt { malloc })
150 pub(crate) fn client(&self) -> Option<ClientOpt> {
151 if !self.client && self.server {
154 Some(ClientOpt { code_bin: self.code_bin.clone() })