From 0296cd590e4c0a21f75b7ec7b420d849c7e9588e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 6 Mar 2021 23:02:06 +0300 Subject: :arrow_up: xflags --- crates/rust-analyzer/Cargo.toml | 2 +- crates/rust-analyzer/src/bin/flags.rs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'crates') 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" log = "0.4.8" lsp-types = { version = "0.88.0", features = ["proposed"] } parking_lot = "0.11.0" -xflags = "0.1.2" +xflags = "0.2.1" oorandom = "11.1.2" rustc-hash = "1.1.0" 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}; use rust_analyzer::cli::{BenchWhat, Position, Verbosity}; use vfs::AbsPathBuf; -xflags::args_parser! { +xflags::xflags! { + src "./src/bin/flags.rs" + /// LSP server for the Rust programming language. cmd rust-analyzer { /// Verbosity level, can be repeated multiple times. @@ -120,7 +122,7 @@ xflags::args_parser! { // generated start // The following code is generated by `xflags` macro. -// Run `env XFLAGS_DUMP= cargo build` to regenerate. +// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate. #[derive(Debug)] pub struct RustAnalyzer { pub verbose: u32, @@ -158,7 +160,7 @@ pub struct Parse { } #[derive(Debug)] -pub struct Symbols {} +pub struct Symbols; #[derive(Debug)] pub struct Highlight { @@ -211,14 +213,13 @@ pub struct Search { } #[derive(Debug)] -pub struct ProcMacro {} +pub struct ProcMacro; impl RustAnalyzer { - pub const HELP: &'static str = Self::_HELP; + pub const HELP: &'static str = Self::HELP_; pub fn from_env() -> xflags::Result { - let mut p = xflags::rt::Parser::new_from_env(); - Self::_parse(&mut p) + Self::from_env_() } } // generated end -- cgit v1.2.3