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