RustAnalyzer

Struct RustAnalyzer 

Source
pub struct RustAnalyzer {
    pub verbose: u32,
    pub quiet: bool,
    pub log_file: Option<PathBuf>,
    pub no_log_buffering: bool,
    pub wait_dbg: bool,
    pub subcommand: RustAnalyzerCmd,
}

Fields§

§verbose: u32§quiet: bool§log_file: Option<PathBuf>§no_log_buffering: bool§wait_dbg: bool§subcommand: RustAnalyzerCmd

Implementations§

Source§

impl RustAnalyzer

Source

fn from_env_or_exit_() -> Self

Source

fn from_env_() -> Result<Self>

Source

fn from_vec_(args: Vec<OsString>) -> Result<Self>

Source§

impl RustAnalyzer

Source

fn parse_(p_: &mut Parser) -> Result<Self>

Source§

impl RustAnalyzer

Source

const HELP_: &'static str = "rust-analyzer\n LSP server for the Rust programming language.\n\n Subcommands and their flags do not provide any stability guarantees and may be removed or\n changed without notice. Top-level flags that are not marked as [Unstable] provide\n backwards-compatibility and may be relied on.\n\nOPTIONS:\n -v, --verbose\n Verbosity level, can be repeated multiple times.\n\n -q, --quiet\n Verbosity level.\n\n --log-file <path>\n Log to the specified file instead of stderr.\n\n --no-log-buffering\n Flush log records to the file immediately.\n\n --wait-dbg\n [Unstable] Wait until a debugger is attached to (requires debug build).\n\n -h, --help\n Prints help information.\n\n -V, --version\n Print version.\n\n --print-config-schema\n Dump a LSP config JSON schema.\n\nSUBCOMMANDS:\n\nrust-analyzer parse\n Parse stdin.\n\n OPTIONS:\n --no-dump\n Suppress printing.\n\n\nrust-analyzer symbols\n Parse stdin and print the list of symbols.\n\n\nrust-analyzer highlight\n Highlight stdin as html.\n\n OPTIONS:\n --rainbow\n Enable rainbow highlighting of identifiers.\n\n\nrust-analyzer analysis-stats\n Batch typecheck project and print summary statistics\n\n ARGS:\n <path>\n Directory with Cargo.toml or rust-project.json.\n\n OPTIONS:\n --output <format>\n\n --randomize\n Randomize order in which crates, modules, and items are processed.\n\n --parallel\n Run type inference in parallel.\n\n -o, --only <path>\n Only analyze items matching this path.\n\n --with-deps\n Also analyze all dependencies.\n\n --no-sysroot\n Don\'t load sysroot crates (`std`, `core` & friends).\n\n --no-test\n Don\'t set #[cfg(test)].\n\n --disable-build-scripts\n Don\'t run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.\n\n --disable-proc-macros\n Don\'t expand proc macros.\n\n --proc-macro-srv <path>\n Run the proc-macro-srv binary at the specified path.\n\n --skip-lang-items\n Skip lang items fetching.\n\n --skip-lowering\n Skip body lowering.\n\n --skip-inference\n Skip type inference.\n\n --skip-mir-stats\n Skip lowering to mir\n\n --skip-data-layout\n Skip data layout calculation\n\n --skip-const-eval\n Skip const evaluation\n\n --run-all-ide-things\n Runs several IDE features after analysis, including semantics highlighting, diagnostics\n and annotations. This is useful for benchmarking the memory usage on a project that has\n been worked on for a bit in a longer running session.\n\n --run-term-search\n Run term search on all the tail expressions (of functions, block, if statements etc.)\n\n --validate-term-search\n Validate term search by running `cargo check` on every response.\n Note that this also temporarily modifies the files on disk, use with caution!\n\n\nrust-analyzer run-tests\n Run unit tests of the project using mir interpreter\n\n ARGS:\n <path>\n Directory with Cargo.toml or rust-project.json.\n\n\nrust-analyzer rustc-tests\n Run unit tests of the project using mir interpreter\n\n ARGS:\n <rustc_repo>\n Directory with Cargo.toml.\n\n OPTIONS:\n --filter <path>\n Only run tests with filter as substring\n\n\nrust-analyzer diagnostics\n\n ARGS:\n <path>\n Directory with Cargo.toml or rust-project.json.\n\n OPTIONS:\n --disable-build-scripts\n Don\'t run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.\n\n --disable-proc-macros\n Don\'t expand proc macros.\n\n --proc-macro-srv <path>\n Run the proc-macro-srv binary at the specified path.\n\n --severity <severity>\n The minimum severity.\n\n\nrust-analyzer unresolved-references\n Report unresolved references\n\n ARGS:\n <path>\n Directory with Cargo.toml or rust-project.json.\n\n OPTIONS:\n --disable-build-scripts\n Don\'t run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.\n\n --disable-proc-macros\n Don\'t expand proc macros.\n\n --proc-macro-srv <path>\n Run the proc-macro-srv binary at the specified path.\n\n\nrust-analyzer prime-caches\n Prime caches, as rust-analyzer does typically at startup in interactive sessions.\n\n ARGS:\n <path>\n Directory with Cargo.toml or rust-project.json.\n\n OPTIONS:\n --disable-build-scripts\n Don\'t run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.\n\n --disable-proc-macros\n Don\'t expand proc macros.\n\n --proc-macro-srv <path>\n Run the proc-macro-srv binary at the specified path.\n\n --num-threads <num_threads>\n The number of threads to use. Defaults to the number of physical cores.\n\n\nrust-analyzer ssr\n\n ARGS:\n <rule>...\n A structured search replace rule (`$a.foo($b) ==>> bar($a, $b)`)\n\n\nrust-analyzer search\n\n ARGS:\n <pattern>...\n A structured search replace pattern (`$a.foo($b)`)\n\n OPTIONS:\n --debug <snippet>\n Prints debug information for any nodes with source exactly equal to snippet.\n\n\nrust-analyzer lsif\n\n ARGS:\n <path>\n\n OPTIONS:\n --exclude-vendored-libraries\n Exclude code from vendored libraries from the resulting index.\n\n\nrust-analyzer scip\n\n ARGS:\n <path>\n\n OPTIONS:\n --output <path>\n The output path where the SCIP file will be written to. Defaults to `index.scip`.\n\n --config-path <config_path>\n A path to an json configuration file that can be used to customize cargo behavior.\n\n --exclude-vendored-libraries\n Exclude code from vendored libraries from the resulting index.\n"

Source§

impl RustAnalyzer

Source

pub fn from_env_or_exit() -> Self

Source

pub fn from_env() -> Result<Self>

Source

pub fn from_vec(args: Vec<OsString>) -> Result<Self>

Source§

impl RustAnalyzer

Source

pub fn verbosity(&self) -> Verbosity

Trait Implementations§

Source§

impl Debug for RustAnalyzer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, R> CollectAndApply<T, R> for T

§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

§

type Output = R

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Lookup<T> for T

§

fn into_owned(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

§

fn upcast(self, interner: I) -> U

§

impl<I, T> UpcastFrom<I, T> for T

§

fn upcast_from(from: T, _tcx: I) -> T

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

§

impl<T> ErasedDestructor for T
where T: 'static,