coc-rust-analyzer
Heyward Fannrust-analyzer for Vim/Neovim, works as an extension with coc.nvim
Published Package Summary
coc-rust-analyzer
rust-analyzer for Vim/Neovim, works as an extension with coc.nvim.
Install
:CocInstall coc-rust-analyzer
remove
rust-analyzerconfig fromcoc-settings.jsonif you've set
Notes
It's recommended to add $CARGO_HOME to workspace.ignoredFolders to stop rust-analyzer runs cargo check on sysroot crates:
"workspace.ignoredFolders": [
"$HOME",
"$HOME/.cargo/**",
"$HOME/.rustup/**"
],
Configurations
This extension is configured using a jsonc file. You can open this configuration file using the command :CocConfig, and it is typically located at $HOME/.config/nvim/coc-settings.json. You can get the configurations list from the package.json file of this extension.
Debugging with Vimspector
To debug Rust runnables with Vimspector, set the debug runtime in coc-settings.json:
{
"rust-analyzer.debug.runtime": "vimspector"
}
Install Vimspector and the CodeLLDB adapter with :VimspectorInstall CodeLLDB. Then add a Vimspector configuration, either in the project root as .vimspector.json or in a global Vimspector configuration file:
{
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
"configurations": {
"launch": {
"adapter": "CodeLLDB",
"configuration": {
"request": "launch",
"program": "${Executable}",
"args": ["*${Args}"]
}
}
}
}
The launch key must match rust-analyzer.debug.vimspector.configuration.name, which defaults to launch. :CocCommand rust-analyzer.debug passes Executable and Args to Vimspector for the selected runnable.
License
MIT
This extension is built with create-coc-extension
- rust-analyzer for Vim/Neovim, works as an extension with coc.nvim
- onLanguage:rust
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-rust-analyzer@0.89.2.
| Command (:CocCommand) | Description |
|---|---|
| rust-analyzer.analyzerStatus | Status |
| rust-analyzer.memoryUsage | Memory Usage (Clears Database) |
| rust-analyzer.reloadWorkspace | Reload workspace |
| rust-analyzer.joinLines | Join lines |
| rust-analyzer.matchingBrace | Find matching brace |
| rust-analyzer.openDocs | Open docs under cursor |
| rust-analyzer.openCargoToml | Open Cargo.toml |
| rust-analyzer.parentModule | Locate parent module |
| rust-analyzer.reload | Restart server |
| rust-analyzer.run | Run |
| rust-analyzer.debug | Debug |
| rust-analyzer.ssr | Structural Search Replace |
| rust-analyzer.serverVersion | Show current Rust Analyzer server version |
| rust-analyzer.viewSyntaxTree | View Syntax Tree |
| rust-analyzer.testCurrent | Test Current |
| rust-analyzer.install | Install Rust Analyzer from GitHub release |
| rust-analyzer.upgrade | Upgrade Rust Analyzer from GitHub release |
| rust-analyzer.expandMacro | Expand macro recursively at caret |
| rust-analyzer.viewHir | View Hir |
| rust-analyzer.viewMir | View Mir |
| rust-analyzer.viewFileText | View File Text (as seen by the server) |
| rust-analyzer.viewItemTree | Debug ItemTree |
| rust-analyzer.viewCrateGraph | View Crate Graph |
| rust-analyzer.shuffleCrateGraph | Shuffle Crate Graph |
| rust-analyzer.viewFullCrateGraph | View Crate Graph (Full) |
| rust-analyzer.echoRunCommandLine | Echo Run Command Line |
| rust-analyzer.peekTests | Peek related tests |
| rust-analyzer.moveItemUp | Move item up |
| rust-analyzer.moveItemDown | Move item down |
| rust-analyzer.runFlycheck | Run flycheck |
| rust-analyzer.cancelFlycheck | Cancel running flychecks |
| rust-analyzer.clearFlycheck | Clear flycheck diagnostics |
| rust-analyzer.viewMemoryLayout | View Memory Layout |
| rust-analyzer.rebuildProcMacros | Rebuild proc macros and build scripts |
| rust-analyzer.interpretFunction | Interpret Function |
| rust-analyzer.explainError | Explain the currently hovered diagnostic |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Enable `coc-rust-analyzer`"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [
"debug_assertions",
"miri"
],
"markdownDescription": "List of cfg options to enable with the given values.\n\nTo enable a name without a value, use `\"key\"`.\nTo enable a name with a value, use `\"key=value\"`.\nTo disable, prefix the entry with a `!`."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"type": "number",
"maximum": 255,
"minimum": 0
},
{
"enum": [
"physical",
"logical"
],
"type": "string",
"enumDescriptions": [
"Use the number of physical cores",
"Use the number of logical cores"
]
}
],
"default": null,
"markdownDescription": "The number of worker threads in the main loop. The default `null` means to pick\nautomatically."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Set `cfg(test)` for local crates. Defaults to true."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Run the check command for diagnostics on save."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show CodeLens in Rust files."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "Path to rust-analyzer executable (points to bundled binary by default). If this is set, then \"rust-analyzer.updates.channel\" setting is not used"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Whether to skip fetching dependencies. If set to \"true\", the analysis is performed\nentirely offline, and Cargo metadata for dependencies is not fetched."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "Compilation target override (target tuple)."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"uniqueItems": true,
"markdownDescription": "List of `cargo check` (or other command specified in `check.command`) diagnostics to ignore.\n\nFor example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`,..."
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"default": null,
"maximum": 65535,
"minimum": 0,
"markdownDescription": "Number of syntax trees rust-analyzer keeps in memory. Defaults to 128."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private\nprojects, or \"discover\" to try to automatically find it if the `rustc-dev` component\nis installed.\n\nAny project which uses rust-analyzer with the rustcPrivate\ncrates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.\n\nThis option does not take effect until rust-analyzer is restarted."
}Raw JSON Schema
{
"enum": [
"off",
"messages",
"verbose"
],
"type": "string",
"scope": "window",
"default": "off",
"enumDescriptions": [
"No traces",
"Error only",
"Full log"
],
"markdownDescription": "Trace requests to the rust-analyzer"
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": "discover",
"markdownDescription": "Relative path to the sysroot, or \"discover\" to try to automatically find it via\n\"rustc --print sysroot\".\n\nUnsetting this disables sysroot loading.\n\nThis option does not take effect until rust-analyzer is restarted."
}Raw JSON Schema
{
"type": "string",
"default": "check",
"markdownDescription": "Cargo command to use for `cargo check`."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"default": null,
"markdownDescription": "Check for specific targets. Defaults to `#rust-analyzer.cargo.target#` if empty.\n\nCan be a single target, e.g. `\"x86_64-unknown-linux-gnu\"` or a list of targets, e.g.\n`[\"aarch64-apple-darwin\", \"x86_64-apple-darwin\"]`.\n\nAliased as `\"checkOnSave.targets\"`."
}Raw JSON Schema
{
"enum": [
"termdebug",
"vimspector",
"nvim-dap"
],
"type": "string",
"default": "termdebug",
"enumDescriptions": [
"`\"termdebug\"` use vim/neovim builtin debugger - gdb",
"`\"vimspector\"` use vimspector plugin",
"`\"nvim-dap\"` use nvim-dap plugin"
],
"markdownDescription": "Choose which debug runtime to use"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "List of files to ignore\n\nThese paths (file/directories) will be ignored by rust-analyzer. They are relative to\nthe workspace root, and globs are not supported. You may also need to add the folders to\nCode's `files.watcherExclude`."
}Raw JSON Schema
{
"enum": [
"client",
"server"
],
"type": "string",
"default": "client",
"enumDescriptions": [
"Use the client (editor) to watch files for changes",
"Use server-side file watching"
],
"markdownDescription": "Controls file watching implementation."
}Raw JSON Schema
{
"enum": [
"above_name",
"above_whole_item"
],
"type": "string",
"default": "above_name",
"enumDescriptions": [
"Render annotations above the name of the item.",
"Render annotations above the whole item, including documentation comments and attributes."
],
"markdownDescription": "Where to render annotations."
}Raw JSON Schema
{
"type": "object",
"default": {},
"markdownDescription": "Extra environment variables that will be set when running cargo, rustc\nor other commands within the workspace. Useful for setting RUSTFLAGS."
}Raw JSON Schema
{
"anyOf": [
{
"enum": [
"all"
],
"type": "string",
"enumDescriptions": [
"Pass `--all-features` to cargo"
]
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"default": [],
"markdownDescription": "List of features to activate.\n\nSet this to `\"all\"` to pass `--all-features` to cargo."
}Raw JSON Schema
{
"type": "object",
"default": {},
"markdownDescription": "Extra environment variables that will be set when running `cargo check`.\nExtends `#rust-analyzer.cargo.extraEnv#`."
}Raw JSON Schema
{
"anyOf": [
{
"enum": [
"all"
],
"type": "string",
"enumDescriptions": [
"Pass `--all-features` to cargo"
]
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"markdownDescription": "List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`.\n\nSet to `\"all\"` to pass `--all-features` to Cargo."
}Raw JSON Schema
{
"enum": [
"plain",
"self",
"crate"
],
"type": "string",
"default": "crate",
"enumDescriptions": [
"Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.",
"Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item. Prefixes `self` in front of the path if it starts with a module.",
"Force import paths to be absolute by always starting them with `crate` or the extern crate name they come from."
],
"markdownDescription": "The path structure for newly inserted paths to use."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": [
"string",
"object"
]
},
"default": [],
"markdownDescription": "Disable project auto-discovery in favor of explicitly specified set of projects.\n\nElements must be paths pointing to `Cargo.toml`, `rust-project.json`, `.rs` files (which\nwill be treated as standalone files) or JSON objects in `rust-project.json` format."
}Raw JSON Schema
{
"enum": [
true,
false,
"neverDownload"
],
"type": [
"boolean",
"string"
],
"default": true,
"markdownDescription": "Prompt the user before downloading rust-analyzer"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Extra arguments that are passed to every cargo invocation."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "string"
}
],
"default": null,
"markdownDescription": "Optional path to a rust-analyzer specific target directory.\nThis prevents rust-analyzer's `cargo check` and initial build-script and proc-macro\nbuilding from locking the `Cargo.lock` at the expense of duplicating build artifacts.\n\nSet to `true` to use a subdirectory of the existing target directory or\nset to a path relative to the workspace to use that path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Extra arguments for `cargo check`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Whether `--workspace` should be passed to `cargo check`.\nIf false, `-p <package>` will be passed instead if applicable. In case it is not, no\ncheck will be performed."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Enable the experimental support for interpreting tests."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show `Run` lens. Only applies when `#rust-analyzer.lens.enable#` is set."
}Raw JSON Schema
{
"type": [
"null",
"object"
],
"default": null,
"markdownDescription": "Extra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. `RA_LOG` for debugging."
}Raw JSON Schema
{
"enum": [
"stable",
"nightly"
],
"type": "string",
"default": "stable",
"enumDescriptions": [
"`\"stable\"` updates are shipped weekly, they don't contain cutting-edge features from VSCode proposed APIs but have less bugs in general",
"`\"nightly\"` updates are shipped daily (extension updates automatically by downloading artifacts directly from GitHub), they contain cutting-edge features and latest bug fixes. These releases help us get your feedback very quickly and speed up rust-analyzer development **drastically**"
],
"markdownDescription": "Choose `\"nightly\"` updates to get the latest features and bug fixes every day. While `\"stable\"` releases occur weekly and don't contain cutting-edge features from VSCode proposed APIs"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Pass `--all-targets` to cargo invocation."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Automatically refresh project info via `cargo metadata` on\n`Cargo.toml` or `.cargo/config.toml` changes."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "Relative path to the sysroot library sources. If left unset, this will default to\n`{cargo.sysroot}/lib/rustlib/src/rust/library`.\n\nThis option does not take effect until rust-analyzer is restarted."
}Raw JSON Schema
{
"type": [
"null",
"boolean"
],
"default": null,
"markdownDescription": "Check all targets and tests (`--all-targets`). Defaults to\n`#rust-analyzer.cargo.allTargets#`."
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"default": null,
"minimum": 0,
"markdownDescription": "Maximum number of completions to return. If `None`, the limit is infinite."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "Internal config, path to proc-macro server executable."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Prefer to use `Self` over the type name when inserting a type (e.g. in \"fill match arms\" assist)."
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"default": 5,
"minimum": 0,
"markdownDescription": "How many fields of a struct, variant or union to display when hovering on. Show none if\nempty."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show `Debug` lens. Only applies when `#rust-analyzer.lens.enable#` is set."
}Raw JSON Schema
{
"type": "object",
"default": {},
"markdownDescription": "These proc-macros will be ignored when trying to expand them.\n\nThis config takes a map of crate names with the exported proc-macro names to ignore as values."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "Command to be executed instead of 'cargo' for runnables."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Additional arguments to `rustfmt`."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Additional paths to include in the VFS. Generally for code that is\ngenerated or otherwise managed by a build system outside of Cargo,\nthough Cargo might be the eventual consumer."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Insert #[must_use] when generating `as_` methods for enum variants."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show native rust-analyzer diagnostics."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Use markdown syntax for links on hover."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Allow import insertion to merge new imports into single path glob imports like `use\nstd::fmt::*;`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Warm up caches on project load."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Prefer to unconditionally use imports of the core and alloc crate, over the std crate."
}Raw JSON Schema
{
"anyOf": [
{
"type": "number",
"maximum": 255,
"minimum": 0
},
{
"enum": [
"physical"
],
"type": "string",
"enumDescriptions": [
"Use the number of physical cores"
]
}
],
"default": 1,
"markdownDescription": "Number of proc-macro server processes to spawn.\n\nControls how many independent `proc-macro-srv` processes rust-analyzer\nruns in parallel to handle macro expansion."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Additional arguments to be passed to cargo for runnables such as\ntests or binaries. For example, it may be `--release`."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": "=.",
"markdownDescription": "Specify the characters allowed to invoke special on typing triggers.\n\n- typing `=` after `let` tries to smartly add `;` if `=` is followed by an existing\n expression\n- typing `=` between two expressions adds `;` when in statement position\n- typing `=` to turn an assignment into an equality comparison removes `;` when in\n expression position\n- typing `.` in a chain method call auto-indents\n- typing `{` or `(` in front of an expression inserts a closing `}` or `)` after the\n expression\n- typing `{` in a use item adds a closing `}` in the right place\n- typing `>` to complete a return type `->` will insert a whitespace after it\n- typing `<` in a path or type position inserts a closing `>` after the path or type."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"uniqueItems": true,
"markdownDescription": "List of rust-analyzer diagnostics to disable."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Group inserted imports by the [following\norder](https://rust-analyzer.github.io/book/features.html#auto-import). Groups are\nseparated by newlines."
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"default": 25,
"minimum": 0,
"markdownDescription": "Maximum length for inlay hints. Set to null to have an unlimited length.\n\n**Note:** This is mostly a hint, and we don't guarantee to strictly follow the limit."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Join lines inserts else between consecutive ifs."
}Raw JSON Schema
{
"type": "object",
"default": {},
"markdownDescription": "The LRU capacity of the specified queries."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Whether to warn when a rename will cause conflicts (change the meaning of the code)."
}Raw JSON Schema
{
"enum": [
"full",
"parameters"
],
"type": "string",
"default": "full",
"enumDescriptions": [
"Show the entire signature.",
"Show only the parameters."
],
"markdownDescription": "Show full signature of the callable. Only shows parameters if disabled."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Enter insert mode after terminal displayed"
}Raw JSON Schema
{
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"default": null,
"markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefore include `--message-format=json` or a similar option\n(if your client supports the `colorDiagnosticOutput` experimental\ncapability, you can use `--message-format=json-diagnostic-rendered-ansi`).\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nIf there are multiple linked projects/workspaces, this command is invoked for\neach of them, with the working directory being the workspace root\n(i.e., the folder containing the `Cargo.toml`). This can be overwritten\nby changing `#rust-analyzer.check.invocationStrategy#`.\n\nIt supports two interpolation syntaxes, both mainly intended to be used with\n[non-Cargo build systems](./non_cargo_based_projects.md):\n\n- If `{saved_file}` is part of the command, rust-analyzer will pass\n the absolute path of the saved file to the provided command.\n (A previous version, `$saved_file`, also works.)\n- If `{label}` is part of the command, rust-analyzer will pass the\n Cargo package ID, which can be used with `cargo check -p`, or a build label from\n `rust-project.json`. If `{label}` is included, rust-analyzer behaves much like\n [`\"rust-analyzer.check.workspace\": false`](#check.workspace).\n\n\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n\nNote: The option must be specified as an array of command line arguments, with\nthe first argument being the name of the command to run."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Disable support for `#[rust_analyzer::rust_fixture]` snippets.\n\nIf you are not working on rust-analyzer itself, you should ignore this config."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show drop glue information on hover."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Prefer import paths containing a `prelude` module."
}Raw JSON Schema
{
"type": "integer",
"default": 1800,
"minimum": 0,
"markdownDescription": "Term search fuel in \"units of work\" for assists (Defaults to 1800)."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show `Update Test` lens. Only applies when `#rust-analyzer.lens.enable#` and\n`#rust-analyzer.lens.run.enable#` are set."
}Raw JSON Schema
{
"type": "string",
"default": "test",
"markdownDescription": "Subcommand used for test runnables instead of `test`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Auto-check rust-analyzer updates on startup"
}Raw JSON Schema
{
"anyOf": [
{
"type": "number",
"maximum": 255,
"minimum": 0
},
{
"enum": [
"physical",
"logical"
],
"type": "string",
"enumDescriptions": [
"Use the number of physical cores",
"Use the number of logical cores"
]
}
],
"default": "physical",
"markdownDescription": "How many worker threads to handle priming caches. The default `0` means to pick\nautomatically."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Extra arguments passed only to `cargo metadata`, not to other cargo invocations.\nUseful for flags like `--config` that `cargo metadata` supports."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Whether to pass `--no-default-features` to cargo."
}Raw JSON Schema
{
"type": [
"null",
"boolean"
],
"default": null,
"markdownDescription": "Whether to pass `--no-default-features` to Cargo. Defaults to\n`#rust-analyzer.cargo.noDefaultFeatures#`."
}Raw JSON Schema
{
"type": "object",
"default": {},
"markdownDescription": "Map of prefixes to be substituted when parsing diagnostic file paths. This should be the\nreverse mapping of what is passed to `rustc` as `--remap-path-prefix`."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"enum": [
"both",
"decimal",
"hexadecimal"
],
"type": "string",
"enumDescriptions": [
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
],
"default": "both",
"markdownDescription": "How to render the size information in a memory layout hover."
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"default": 5,
"minimum": 0,
"markdownDescription": "How many variants of an enum to display when hovering on. Show none if empty."
}Raw JSON Schema
{
"enum": [
"impl_fn",
"rust_analyzer",
"with_id",
"hide"
],
"type": "string",
"default": "impl_fn",
"enumDescriptions": [
"`impl_fn`: `impl FnMut(i32, u64) -> i8`",
"`rust_analyzer`: `|i32, u64| -> i8`",
"`with_id`: `{closure#14352}`, where that id is the unique number of the closure in r-a internals",
"`hide`: Shows `...` for every closure type"
],
"markdownDescription": "Closure notation in type and chaining inlay hints."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Whether to render leading colons for type hints, and trailing colons for parameter hints."
}Raw JSON Schema
{
"type": [
"null",
"string"
],
"default": null,
"markdownDescription": "The path where to save memory profiling output.\n\n**Note:** Memory profiling is not enabled by default in rust-analyzer builds, you need to build\nfrom source for it."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Exclude tests from find-all-references and call-hierarchy."
}Raw JSON Schema
{
"type": "string",
"default": "bench",
"markdownDescription": "Subcommand used for bench runnables instead of `bench`."
}Raw JSON Schema
{
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"default": null,
"markdownDescription": "Advanced option, fully override the command rust-analyzer uses for\nformatting. This should be the equivalent of `rustfmt` here, and\nnot that of `cargo fmt`. The file contents will be passed on the\nstandard input and the formatted result will be read from the\nstandard output.\n\nNote: The option must be specified as an array of command line arguments, with\nthe first argument being the name of the command to run."
}Raw JSON Schema
{
"enum": [
"per_workspace",
"once"
],
"type": "string",
"default": "per_workspace",
"enumDescriptions": [
"The command will be executed for each Rust workspace with the workspace as the working directory.",
"The command will be executed once with the opened project as the working directory."
],
"markdownDescription": "Specifies the invocation strategy to use when running the check command.\nIf `per_workspace` is set, the command will be executed for each workspace.\nIf `once` is set, the command will be executed once.\nThis config only has an effect when `#rust-analyzer.check.overrideCommand#`\nis set."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "A list of full paths to traits whose methods to exclude from completion.\n\nMethods from these traits won't be completed, even if the trait is in scope. However,\nthey will still be suggested on expressions whose type is `dyn Trait`, `impl Trait` or\n`T where T: Trait`.\n\nNote that the trait themselves can still be completed."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"properties": {
"command": {
"type": "array",
"items": {
"type": "string"
}
},
"filesToWatch": {
"type": "array",
"items": {
"type": "string"
}
},
"progressLabel": {
"type": "string"
}
}
}
],
"default": null,
"markdownDescription": "Configure a command that rust-analyzer can invoke to\nobtain configuration.\n\nThis is an alternative to manually generating\n`rust-project.json`: it enables rust-analyzer to generate\nrust-project.json on the fly, and regenerate it when\nswitching or modifying projects.\n\nThis is an object with three fields:\n\n* `command`: the shell command to invoke\n\n* `filesToWatch`: which build system-specific files should\nbe watched to trigger regenerating the configuration\n\n* `progressLabel`: the name of the command, used in\nprogress indicators in the IDE\n\nHere's an example of a valid configuration:\n\n```json\n\"rust-analyzer.workspace.discoverConfig\": {\n \"command\": [\n \"rust-project\",\n \"develop-json\",\n \"{arg}\"\n ],\n \"progressLabel\": \"buck2/rust-project\",\n \"filesToWatch\": [\n \"BUCK\"\n ]\n}\n```\n\n## Argument Substitutions\n\nIf `command` includes the argument `{arg}`, that argument will be substituted\nwith the JSON-serialized form of the following enum:\n\n```norun\n#[derive(PartialEq, Clone, Debug, Serialize)]\n#[serde(rename_all = \"camelCase\")]\npub enum DiscoverArgument {\n Path(AbsPathBuf),\n Buildfile(AbsPathBuf),\n}\n```\n\nrust-analyzer will use the path invocation to find and\ngenerate a `rust-project.json` and therefore a\nworkspace. Example:\n\n\n```norun\nrust-project develop-json '{ \"path\": \"myproject/src/main.rs\" }'\n```\n\nrust-analyzer will use build file invocations to update an\nexisting workspace. Example:\n\nOr with a build file and the configuration above:\n\n```norun\nrust-project develop-json '{ \"buildfile\": \"myproject/BUCK\" }'\n```\n\nAs a reference for implementors, buck2's `rust-project`\nwill likely be useful:\n<https://github.com/facebook/buck2/tree/main/integrations/rust-project>.\n\n## Discover Command Output\n\n**Warning**: This format is provisional and subject to change.\n\nThe discover command should output JSON objects, one per\nline (JSONL format). These objects should correspond to\nthis Rust data type:\n\n```norun\n#[derive(Debug, Clone, Deserialize, Serialize)]\n#[serde(tag = \"kind\")]\n#[serde(rename_all = \"snake_case\")]\nenum DiscoverProjectData {\n Finished { buildfile: Utf8PathBuf, project: ProjectJsonData },\n Error { error: String, source: Option<String> },\n Progress { message: String },\n}\n```\n\nFor example, a progress event:\n\n```json\n{\"kind\":\"progress\",\"message\":\"generating rust-project.json\"}\n```\n\nA finished event can look like this (expanded and\ncommented for readability):\n\n```json\n{\n // the internally-tagged representation of the enum.\n \"kind\": \"finished\",\n // the file used by a non-Cargo build system to define\n // a package or target.\n \"buildfile\": \"rust-analyzer/BUCK\",\n // the contents of a rust-project.json, elided for brevity\n \"project\": {\n \"sysroot\": \"foo\",\n \"crates\": []\n }\n}\n```\n\nOnly the finished event is required, but the other\nvariants are encouraged to give users more feedback about\nprogress or errors."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Run build scripts (`build.rs`) for more precise code analysis."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Omit deprecated items from completions. By default they are marked as deprecated but not\nhidden."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show postfix snippets like `dbg`, `if`, `not`, etc."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show memory layout data on hover."
}Raw JSON Schema
{
"type": [
"null",
"boolean"
],
"default": false,
"markdownDescription": "How to render the niche information in a memory layout hover."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"enum": [
"both",
"decimal",
"hexadecimal"
],
"type": "string",
"enumDescriptions": [
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
],
"default": "hexadecimal",
"markdownDescription": "How to render the offset information in a memory layout hover."
}Raw JSON Schema
{
"enum": [
"crate",
"module",
"item",
"one",
"preserve"
],
"type": "string",
"default": "crate",
"enumDescriptions": [
"Merge imports from the same crate into a single use statement. Conversely, imports from different crates are split into separate statements.",
"Merge imports from the same module into a single use statement. Conversely, imports from different modules are split into separate statements.",
"Flatten imports so that each has its own use statement.",
"Merge all imports into a single use statement as long as they have the same visibility and attributes.",
"Deprecated - unless `enforceGranularity` is `true`, the style of the current file is preferred over this setting. Behaves like `item`."
],
"markdownDescription": "How imports should be grouped into use statements."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Join lines merges consecutive declaration and initialization of an assignment."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Exclude imports from find-all-references."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show method call completions with `iter()` or `into_iter()` prefixed to them when\ncompleting on a type that has them."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show method calls and field access completions with `self` prefixed to them when\ninside a method."
}Raw JSON Schema
{
"type": "object",
"default": {
"Ok": {
"body": "Ok(${receiver})",
"scope": "expr",
"postfix": "ok",
"description": "Wrap the expression in a `Result::Ok`"
},
"Err": {
"body": "Err(${receiver})",
"scope": "expr",
"postfix": "err",
"description": "Wrap the expression in a `Result::Err`"
},
"Some": {
"body": "Some(${receiver})",
"scope": "expr",
"postfix": "some",
"description": "Wrap the expression in an `Option::Some`"
},
"Rc::new": {
"body": "Rc::new(${receiver})",
"scope": "expr",
"postfix": "rc",
"requires": "std::rc::Rc",
"description": "Put the expression into an `Rc`"
},
"Arc::new": {
"body": "Arc::new(${receiver})",
"scope": "expr",
"postfix": "arc",
"requires": "std::sync::Arc",
"description": "Put the expression into an `Arc`"
},
"Box::pin": {
"body": "Box::pin(${receiver})",
"scope": "expr",
"postfix": "pinbox",
"requires": "std::boxed::Box",
"description": "Put the expression into a pinned `Box`"
}
},
"markdownDescription": "Custom completion snippets."
}Raw JSON Schema
{
"type": "integer",
"default": 1000,
"minimum": 0,
"markdownDescription": "Term search fuel in \"units of work\" for autocompletion (Defaults to 1000)."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "List of warnings that should be displayed with hint severity.\n\nThe warnings will be indicated by faded text or three dots in code and will not show up\nin the `Problems Panel`."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "List of warnings that should be displayed with info severity.\n\nThe warnings will be indicated by a blue squiggly underline in code and a blue icon in\nthe `Problems Panel`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show documentation on hover."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"enum": [
"both",
"decimal",
"hexadecimal"
],
"type": "string",
"enumDescriptions": [
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
],
"default": null,
"markdownDescription": "How to render the padding information in a memory layout hover."
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"default": null,
"minimum": 0,
"markdownDescription": "How many associated items of a trait to display when hovering a trait."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show `References` lens for Struct, Enum, and Union. Only applies when\n`#rust-analyzer.lens.enable#` is set."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show method calls and field accesses completions with `await` prefixed to them when\ncompleting on a future."
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"enum": [
"hide"
],
"type": "string"
},
{
"type": "integer"
}
],
"default": 20,
"markdownDescription": "Show what types are used as generic arguments in calls etc. on hover, and limit the max\nlength to show such types, beyond which they will be shown with ellipsis.\n\nThis can take three values: `null` means \"unlimited\", the string `\"hide\"` means to not\nshow generic substitutions at all, and a number means to limit them to X characters.\n\nThe default is 20 characters."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Enforce the import granularity setting for all files. If set to false rust-analyzer will\ntry to keep import styles consistent per file."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Prefix external (including std, core) crate imports with `::`.\n\nE.g. `use ::std::io::Read;`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show inlay type hints for variables."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show `Implementations` lens. Only applies when `#rust-analyzer.lens.enable#` is set."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Whether to restart the server automatically when certain settings that require a restart are changed."
}Raw JSON Schema
{
"enum": [
"todo",
"default"
],
"type": "string",
"default": "todo",
"enumDescriptions": [
"Fill missing expressions with the `todo` macro",
"Fill missing expressions with reasonable defaults, `new` or `default` constructors."
],
"markdownDescription": "Placeholder expression to use for missing expressions in assists."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Automatically add `::` when completing the module.\n\nWill not be completed in `use`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show completions that automatically add imports when completed.\n\nNote that your client must specify the `additionalTextEdits` LSP client capability to\ntruly have this feature enabled."
}Raw JSON Schema
{
"enum": [
"fill_arguments",
"add_parentheses",
"none"
],
"type": "string",
"default": "fill_arguments",
"enumDescriptions": [
"Add call parentheses and pre-fill arguments.",
"Add call parentheses.",
"Do no snippet completions for callables."
],
"markdownDescription": "Add parenthesis and argument snippets when completing function."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Enable term search based snippets like `Some(foo.bar().baz())`."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Disable initialization and workdone progress notifications"
}Raw JSON Schema
{
"anyOf": [
{
"type": "null"
},
{
"enum": [
"both",
"decimal",
"hexadecimal"
],
"type": "string",
"enumDescriptions": [
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
],
"default": "hexadecimal",
"markdownDescription": "How to render the align information in a memory layout hover."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Join lines unwraps trivial blocks."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show `References` lens for Trait. Only applies when `#rust-analyzer.lens.enable#` is\nset."
}Raw JSON Schema
{
"enum": [
"only_types",
"all_symbols"
],
"type": "string",
"default": "only_types",
"enumDescriptions": [
"Search for types only.",
"Search for all symbols kinds."
],
"markdownDescription": "Workspace symbol search kind."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Enable borrow checking for term search code assists. If set to false, also there will be\nmore suggestions, but some of them may not borrow-check."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Automatically add a semicolon when completing unit-returning functions.\n\nIn `match` arms it completes a comma instead."
}Raw JSON Schema
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"path": {
"type": "string"
},
"type": {
"enum": [
"always",
"methods",
"sub_items",
"variants"
],
"type": "string",
"enumDescriptions": [
"Do not show this item or its methods (if it is a trait) in auto-import completions.",
"Do not show this trait's methods in auto-import completions.",
"Do not show this module's all items in it in auto-import completions."
]
}
}
}
]
},
"default": [
{
"path": "core::borrow::Borrow",
"type": "methods"
},
{
"path": "core::borrow::BorrowMut",
"type": "methods"
}
],
"markdownDescription": "A list of full paths to items to exclude from auto-importing completions.\n\nTraits in this list won't have their methods suggested in completions unless the trait\nis in scope.\n\nYou can either specify a string path which defaults to type \"always\" or use the more\nverbose form `{ \"path\": \"path::to::item\", type: \"always\" }`.\n\nFor traits the type \"methods\" can be used to only exclude the methods but not the trait\nitself.\n\nFor modules the type \"sub_items\" can be used to only exclude the all items in it but not the module\nitself. This does not include items defined in nested modules.\n\nFor enums the type \"variants\" can be used to only exclude the all variants in it but not the enum\nitself.\n\nThis setting also inherits `#rust-analyzer.completion.excludeTraits#`."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Run additional style lints."
}Raw JSON Schema
{
"enum": [
"inline",
"end_of_line"
],
"type": "string",
"default": "inline",
"enumDescriptions": [
"Render type hints directly after the binding identifier.",
"Render type hints after the end of the containing `let` statement when possible."
],
"markdownDescription": "Where to render type hints relative to their binding pattern."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Join lines removes trailing commas."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show `Method References` lens. Only applies when `#rust-analyzer.lens.enable#` is set."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [
"--nocapture"
],
"markdownDescription": "Additional arguments to be passed through Cargo to launched tests, benchmarks, or\ndoc-tests.\n\nUnless the launched target uses a\n[custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),\nthey will end up being interpreted as options to\n[`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments)."
}Raw JSON Schema
{
"type": "integer",
"default": 128,
"minimum": 0,
"markdownDescription": "Limits the number of items returned from a workspace symbol search (Defaults to 128).\nSome clients like vs-code issue new searches on result filtering and don't require all results to be returned in the initial search.\nOther clients requires all results upfront and might require a higher limit."
}Raw JSON Schema
{
"enum": [
"workspace",
"workspace_and_dependencies"
],
"type": "string",
"default": "workspace",
"enumDescriptions": [
"Search in current workspace only.",
"Search in current workspace and dependencies."
],
"markdownDescription": "Workspace symbol search scope."
}Raw JSON Schema
{
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"default": null,
"markdownDescription": "Override the command used for test runnables.\nThe first element of the array should be the program to execute (for example, `cargo`).\n\nAvailable placeholders:\n- `${package}`: package name.\n- `${target_arg}`: target option such as `--bin`, `--test`, `--lib`, etc.\n- `${target}`: target name (empty for `--lib`).\n- `${test_name}`: the test path filter, e.g. `module::test_func`.\n- `${exact}`: `--exact` for single tests, empty for modules.\n- `${include_ignored}`: `--include-ignored` for single tests, empty otherwise.\n- `${executable_args}`: all of the above binary args bundled together\n (includes `rust-analyzer.runnables.extraTestBinaryArgs`)."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Enables the use of rustfmt's unstable range formatting command for the\n`textDocument/rangeFormatting` request. The rustfmt option is unstable and only\navailable on a nightly build."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show experimental rust-analyzer diagnostics that might have more false positives than\nusual."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show `Update Test` action. Only applies when `#rust-analyzer.hover.actions.enable#` and\n`#rust-analyzer.hover.actions.run.enable#` are set."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show inlay type hints for method chains."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show implicit drop hints."
}Raw JSON Schema
{
"enum": [
"always",
"never",
"mutable"
],
"type": "string",
"default": "never",
"enumDescriptions": [
"Always show reborrow hints.",
"Never show reborrow hints.",
"Only show mutable reborrow hints."
],
"markdownDescription": "Show inlay hints for compiler inserted reborrows.\n\nThis setting is deprecated in favor of\n#rust-analyzer.inlayHints.expressionAdjustmentHints.enable#."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show `can't find Cargo.toml` error message."
}Raw JSON Schema
{
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"default": null,
"markdownDescription": "Override the command used for bench runnables.\nThe first element of the array should be the program to execute (for example, `cargo`).\n\nUse the placeholders:\n- `${package}`: package name.\n- `${target_arg}`: target option such as `--bin`, `--test`, `--lib`, etc.\n- `${target}`: target name (empty for `--lib`).\n- `${test_name}`: the test path filter, e.g. `module::bench_func`.\n- `${exact}`: `--exact` for single benchmarks, empty for modules.\n- `${include_ignored}`: always empty for benchmarks.\n- `${executable_args}`: all of the above binary args bundled together\n (includes `rust-analyzer.runnables.extraTestBinaryArgs`)."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Rerun proc-macros building/build-scripts running when proc-macro\nor build-script sources change and are saved."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show function parameter name inlay hints at the call site."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show completions of private items and fields that are defined in the current workspace\neven if they are not visible at the current position."
}Raw JSON Schema
{
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"default": null,
"markdownDescription": "Override the command used for doc-test runnables.\nThe first element of the array should be the program to execute (for example, `cargo`).\n\nUse the placeholders:\n- `${package}`: package name.\n- `${target_arg}`: target option such as `--bin`, `--test`, `--lib`, etc.\n- `${target}`: target name (empty for `--lib`).\n- `${test_name}`: the test path filter, e.g. `module::func`.\n- `${exact}`: always empty for doc-tests.\n- `${include_ignored}`: always empty for doc-tests.\n- `${executable_args}`: all of the above binary args bundled together\n (includes `rust-analyzer.runnables.extraTestBinaryArgs`)."
}Raw JSON Schema
{
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"default": null,
"markdownDescription": "Override the command rust-analyzer uses to run build scripts and\nbuild procedural macros. The command is required to output json\nand should therefore include `--message-format=json` or a similar\noption.\n\nIf there are multiple linked projects/workspaces, this command is invoked for\neach of them, with the working directory being the workspace root\n(i.e., the folder containing the `Cargo.toml`). This can be overwritten\nby changing `#rust-analyzer.cargo.buildScripts.invocationStrategy#`.\n\nBy default, a cargo invocation will be constructed for the configured\ntargets and features, with the following base command line:\n\n```bash\ncargo check --quiet --workspace --message-format=json --all-targets --keep-going\n```\n\nNote: The option must be specified as an array of command line arguments, with\nthe first argument being the name of the command to run."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to\navoid checking unnecessary things."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Highlight all exit points while the cursor is on any `return`, `?`, `fn`, or return type\narrow (`->`)."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Highlight related references while the cursor is on any identifier."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show inlay type hints for binding modes."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show `References` lens for Enum Variants. Only applies when\n`#rust-analyzer.lens.enable#` is set."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show documentation."
}Raw JSON Schema
{
"type": "string",
"default": "launch",
"markdownDescription": "Specify the name of the vimspector configuration name. The following args will be passed to the configuration: `Executable` and `Args` (both strings)"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Highlight related references while the cursor is on `break`, `loop`, `while`, or `for`\nkeywords."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Highlight all break points for a loop or block context while the cursor is on any\n`async` or `await` keywords."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show keyword hover popups. Only applies when\n`#rust-analyzer.hover.documentation.enable#` is set."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show inlay hints after a closing `}` to indicate what item it belongs to."
}Raw JSON Schema
{
"enum": [
"always",
"never",
"fieldless"
],
"type": "string",
"default": "never",
"enumDescriptions": [
"Always show all discriminant hints.",
"Never show discriminant hints.",
"Only show discriminant hints on fieldless enum variants."
],
"markdownDescription": "Show enum variant discriminant hints."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Use semantic tokens for strings.\n\nIn some editors (e.g. vscode) semantic tokens override other highlighting grammars.\nBy disabling semantic tokens for strings, other grammars can be used to highlight\ntheir contents."
}Raw JSON Schema
{
"type": "string",
"default": "",
"markdownDescription": "Configuration template used to invoked dap.run([conf](https://github.com/mfussenegger/nvim-dap/blob/0e6b7c47dd70e80793ed39271b2aa712d9366dbc/doc/dap.txt#L656C2-L656C2)). The template will be instantiate like this: `$exe` will be replaced with executable path, `$args` will be replaced with arguments."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Exclude all locals from document symbol search."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Use semantic tokens for comments.\n\nIn some editors (e.g. vscode) semantic tokens override other highlighting grammars.\nBy disabling semantic tokens for comments, other grammars can be used to highlight\ntheir contents."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Use semantic tokens for operators.\n\nWhen disabled, rust-analyzer will emit semantic tokens only for operator tokens when\nthey are tagged with modifiers."
}Raw JSON Schema
{
"enum": [
"per_workspace",
"once"
],
"type": "string",
"default": "per_workspace",
"enumDescriptions": [
"The command will be executed for each Rust workspace with the workspace as the working directory.",
"The command will be executed once with the opened project as the working directory."
],
"markdownDescription": "Specifies the invocation strategy to use when running the build scripts command.\nIf `per_workspace` is set, the command will be executed for each Rust workspace with the\nworkspace as the working directory.\nIf `once` is set, the command will be executed once with the opened project as the\nworking directory.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set."
}Raw JSON Schema
{
"type": "integer",
"default": 25,
"minimum": 0,
"markdownDescription": "Minimum number of lines required before the `}` until the hint is shown (set to 0 or 1\nto always show them)."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show inlay hints for closure captures."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show exclusive range inlay hints."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show inlay hints for the implied `dyn` keyword in trait object types."
}Raw JSON Schema
{
"enum": [
"always",
"never",
"skip_trivial"
],
"type": "string",
"default": "never",
"enumDescriptions": [
"Always show lifetime elision hints.",
"Never show lifetime elision hints.",
"Only show lifetime elision hints if a return type is involved."
],
"markdownDescription": "Show inlay type hints for elided lifetimes in function signatures."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Hide inlay type hints for inferred types."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Emit non-standard tokens and modifiers\n\nWhen enabled, rust-analyzer will emit tokens and modifiers that are not part of the\nstandard set of semantic tokens."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Exclude all imports from workspace symbol search.\n\nIn addition to regular imports (which are always excluded),\nthis option removes public imports (better known as re-exports)\nand removes imports that rename the imported symbol."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Highlight all captures of a closure while the cursor is on the `|` or move keyword of a closure."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Use semantic tokens for punctuation.\n\nWhen disabled, rust-analyzer will emit semantic tokens only for punctuation tokens when\nthey are tagged with modifiers or have a special role."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show full function / method signatures in completion docs."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Highlight related return values while the cursor is on any `match`, `if`, or match arm\narrow (`=>`)."
}Raw JSON Schema
{
"enum": [
"always",
"never",
"with_block"
],
"type": "string",
"default": "never",
"enumDescriptions": [
"Always show type hints for return types of closures.",
"Never show type hints for return types of closures.",
"Only show type hints for return types of closures with blocks."
],
"markdownDescription": "Show inlay type hints for return types of closures."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "If this is `true`, when \"Goto Implementations\" and in \"Implementations\" lens, are triggered on a `struct` or `enum` or `union`, we filter out trait implementations that originate from `derive`s above the type."
}Raw JSON Schema
{
"enum": [
"prefix",
"postfix",
"prefer_prefix",
"prefer_postfix"
],
"type": "string",
"default": "prefix",
"enumDescriptions": [
"Always show adjustment hints as prefix (`*expr`).",
"Always show adjustment hints as postfix (`expr.*`).",
"Show prefix or postfix depending on which uses less parenthesis, preferring prefix.",
"Show prefix or postfix depending on which uses less parenthesis, preferring postfix."
],
"markdownDescription": "Show inlay hints as postfix ops (`.*` instead of `*`, etc)."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show inlay hints for the implied type parameter `Sized` bound."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Hide inlay parameter type hints for closures."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Hide inlay type hints for constructors."
}Raw JSON Schema
{
"enum": [
"always",
"never",
"reborrow"
],
"type": "string",
"default": "never",
"enumDescriptions": [
"Always show all adjustment hints.",
"Never show adjustment hints.",
"Only show auto borrow and dereference adjustment hints."
],
"markdownDescription": "Show inlay hints for type adjustments."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show generic type parameter name inlay hints."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Show const generic parameter name inlay hints."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Hide inlay type hints for `let` statements that initialize to a closure.\n\nOnly applies to closures with blocks, same as\n`#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Inject additional highlighting into doc comments.\n\nWhen enabled, rust-analyzer will highlight rust source in doc comments as well as intra\ndoc links."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show generic lifetime parameter name inlay hints."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Prefer using parameter names as the name for elided lifetime hints if possible."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Show parameter name inlay hints for missing arguments at the call site."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Use specialized semantic tokens for operators.\n\nWhen enabled, rust-analyzer will emit special token types for operator tokens instead\nof the generic `operator` token type."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "When enabled, rust-analyzer will emit a punctuation semantic token for the `!` of macro\ncalls."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Disable reborrows in expression adjustments inlay hints.\n\nReborrows are a pair of a builtin deref then borrow, i.e. `&*`. They are inserted by the compiler but are mostly useless to the programmer.\n\nNote: if the deref is not builtin (an overloaded deref), or the borrow is `&raw const`/`&raw mut`, they are not removed."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Hide inlay hints for type adjustments outside of `unsafe` blocks."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"markdownDescription": "Use specialized semantic tokens for punctuation.\n\nWhen enabled, rust-analyzer will emit special token types for punctuation tokens instead\nof the generic `punctuation` token type."
}

