diff options
author | Aleksey Kladov <[email protected]> | 2021-03-06 20:02:06 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-07 08:12:59 +0000 |
commit | 0296cd590e4c0a21f75b7ec7b420d849c7e9588e (patch) | |
tree | 1b57a3f77193cbd62c22f65720575e5e765674cc /crates | |
parent | 71b8fb7c572eb658ee1136f086d6348aafba1e1d (diff) |
:arrow_up: xflags
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/bin/flags.rs | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 8789f0852..3130785cc 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -24,7 +24,7 @@ jod-thread = "0.1.0" | |||
24 | log = "0.4.8" | 24 | log = "0.4.8" |
25 | lsp-types = { version = "0.88.0", features = ["proposed"] } | 25 | lsp-types = { version = "0.88.0", features = ["proposed"] } |
26 | parking_lot = "0.11.0" | 26 | parking_lot = "0.11.0" |
27 | xflags = "0.1.2" | 27 | xflags = "0.2.1" |
28 | oorandom = "11.1.2" | 28 | oorandom = "11.1.2" |
29 | rustc-hash = "1.1.0" | 29 | rustc-hash = "1.1.0" |
30 | serde = { version = "1.0.106", features = ["derive"] } | 30 | serde = { version = "1.0.106", features = ["derive"] } |
diff --git a/crates/rust-analyzer/src/bin/flags.rs b/crates/rust-analyzer/src/bin/flags.rs index 244912d26..3a7caaf3f 100644 --- a/crates/rust-analyzer/src/bin/flags.rs +++ b/crates/rust-analyzer/src/bin/flags.rs | |||
@@ -6,7 +6,9 @@ use ide_ssr::{SsrPattern, SsrRule}; | |||
6 | use rust_analyzer::cli::{BenchWhat, Position, Verbosity}; | 6 | use rust_analyzer::cli::{BenchWhat, Position, Verbosity}; |
7 | use vfs::AbsPathBuf; | 7 | use vfs::AbsPathBuf; |
8 | 8 | ||
9 | xflags::args_parser! { | 9 | xflags::xflags! { |
10 | src "./src/bin/flags.rs" | ||
11 | |||
10 | /// LSP server for the Rust programming language. | 12 | /// LSP server for the Rust programming language. |
11 | cmd rust-analyzer { | 13 | cmd rust-analyzer { |
12 | /// Verbosity level, can be repeated multiple times. | 14 | /// Verbosity level, can be repeated multiple times. |
@@ -120,7 +122,7 @@ xflags::args_parser! { | |||
120 | 122 | ||
121 | // generated start | 123 | // generated start |
122 | // The following code is generated by `xflags` macro. | 124 | // The following code is generated by `xflags` macro. |
123 | // Run `env XFLAGS_DUMP= cargo build` to regenerate. | 125 | // Run `env UPDATE_XFLAGS=1 cargo build` to regenerate. |
124 | #[derive(Debug)] | 126 | #[derive(Debug)] |
125 | pub struct RustAnalyzer { | 127 | pub struct RustAnalyzer { |
126 | pub verbose: u32, | 128 | pub verbose: u32, |
@@ -158,7 +160,7 @@ pub struct Parse { | |||
158 | } | 160 | } |
159 | 161 | ||
160 | #[derive(Debug)] | 162 | #[derive(Debug)] |
161 | pub struct Symbols {} | 163 | pub struct Symbols; |
162 | 164 | ||
163 | #[derive(Debug)] | 165 | #[derive(Debug)] |
164 | pub struct Highlight { | 166 | pub struct Highlight { |
@@ -211,14 +213,13 @@ pub struct Search { | |||
211 | } | 213 | } |
212 | 214 | ||
213 | #[derive(Debug)] | 215 | #[derive(Debug)] |
214 | pub struct ProcMacro {} | 216 | pub struct ProcMacro; |
215 | 217 | ||
216 | impl RustAnalyzer { | 218 | impl RustAnalyzer { |
217 | pub const HELP: &'static str = Self::_HELP; | 219 | pub const HELP: &'static str = Self::HELP_; |
218 | 220 | ||
219 | pub fn from_env() -> xflags::Result<Self> { | 221 | pub fn from_env() -> xflags::Result<Self> { |
220 | let mut p = xflags::rt::Parser::new_from_env(); | 222 | Self::from_env_() |
221 | Self::_parse(&mut p) | ||
222 | } | 223 | } |
223 | } | 224 | } |
224 | // generated end | 225 | // generated end |