"description":"rust-analyzer invokes binaries set up by its configuration as well as the Rust toolchain's binaries. A malicious actor could exploit this to run arbitrary code on your machine."
"markdownDescription":"Sets the extension responsible for determining which extension the rust-analyzer extension uses to generate `rust-project.json` files. This should should only be used\n if a build system like Buck or Bazel is also in use.",
"markdownDescription":"Whether to show a notification for unlinked files asking the user to add the corresponding Cargo.toml to the linked projects setting.",
"markdownDescription":"Platform(s) filter like \"win32\" or [\"linux\", \"win32\"]. See [process.platform](https://nodejs.org/api/process.html#processplatform) values."
},
"mask":{
"type":"string",
"description":"Runnable name mask"
},
"env":{
"type":"object",
"description":"Variables in form of { \"key\": \"value\"}"
}
}
}
},
{
"type":"object",
"description":"Variables in form of { \"key\": \"value\"}"
"markdownDescription":"Extra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. `RA_LOG` for debugging."
}
}
},
{
"title":"trace",
"properties":{
"rust-analyzer.trace.server":{
"type":"string",
"scope":"window",
"enum":[
"off",
"messages",
"verbose"
],
"enumDescriptions":[
"No traces",
"Error only",
"Full log"
],
"default":"off",
"description":"Trace requests to the rust-analyzer (this is usually overly verbose and not recommended for regular users)."
"markdownDeprecationMessage":"Log level is now controlled by the [Developer: Set Log Level...](command:workbench.action.setLogLevel) command.You can set the log level for the current session and also the default log level from there. This is also available by clicking the gear icon on the OUTPUT tab when Rust Analyzer Client is visible or by passing the --log rust-lang.rust-analyzer:debug parameter to VS Code.",
"First try to use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb), if it's not installed try to use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).",
"markdownDescription":"Whether to show the main part of the rendered rustc output of a diagnostic message.",
"default":false,
"type":"boolean"
},
"rust-analyzer.diagnostics.useRustcErrorCode":{
"markdownDescription":"Whether to show diagnostics using the original rustc error code. If this is false, all rustc diagnostics will have the code 'rustc(Click for full compiler diagnostics)'",
"markdownDescription":"Enable borrow checking for term search code assists. If set to false, also there will be more suggestions, but some of them may not borrow-check.",
"markdownDescription":"Specifies the working directory for running build scripts.\n- \"workspace\": run build scripts for a workspace in the workspace's root directory.\n This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.\n- \"root\": run build scripts in the project's root directory.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set.",
"default":"workspace",
"type":"string",
"enum":[
"workspace",
"root"
],
"enumDescriptions":[
"The command will be executed in the corresponding workspace root.",
"The command will be executed in the project root."
"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 workspace.\nIf `once` is set, the command will be executed once.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set.",
"default":"per_workspace",
"type":"string",
"enum":[
"per_workspace",
"once"
],
"enumDescriptions":[
"The command will be executed for each workspace.",
"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#` and\n`#rust-analyzer.cargo.buildScripts.invocationLocation#`.\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.",
"markdownDescription":"Extra environment variables that will be set when running cargo, rustc\nor other commands within the workspace. Useful for setting RUSTFLAGS.",
"default":{},
"type":"object"
}
}
},
{
"title":"cargo",
"properties":{
"rust-analyzer.cargo.features":{
"markdownDescription":"List of features to activate.\n\nSet this to `\"all\"` to pass `--all-features` to cargo.",
"default":[],
"anyOf":[
{
"type":"string",
"enum":[
"all"
],
"enumDescriptions":[
"Pass `--all-features` to cargo"
]
},
{
"type":"array",
"items":{
"type":"string"
}
}
]
}
}
},
{
"title":"cargo",
"properties":{
"rust-analyzer.cargo.noDefaultFeatures":{
"markdownDescription":"Whether to pass `--no-default-features` to cargo.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"cargo",
"properties":{
"rust-analyzer.cargo.sysroot":{
"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.",
"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.",
"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.",
"default":null,
"anyOf":[
{
"type":"null"
},
{
"type":"boolean"
},
{
"type":"string"
}
]
}
}
},
{
"title":"general",
"properties":{
"rust-analyzer.checkOnSave":{
"markdownDescription":"Run the check command for diagnostics on save.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.allTargets":{
"markdownDescription":"Check all targets and tests (`--all-targets`). Defaults to\n`#rust-analyzer.cargo.allTargets#`.",
"default":null,
"type":[
"null",
"boolean"
]
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.command":{
"markdownDescription":"Cargo command to use for `cargo check`.",
"markdownDescription":"Extra arguments for `cargo check`.",
"default":[],
"type":"array",
"items":{
"type":"string"
}
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.extraEnv":{
"markdownDescription":"Extra environment variables that will be set when running `cargo check`.\nExtends `#rust-analyzer.cargo.extraEnv#`.",
"default":{},
"type":"object"
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.features":{
"markdownDescription":"List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`.\n\nSet to `\"all\"` to pass `--all-features` to Cargo.",
"default":null,
"anyOf":[
{
"type":"string",
"enum":[
"all"
],
"enumDescriptions":[
"Pass `--all-features` to cargo"
]
},
{
"type":"array",
"items":{
"type":"string"
}
},
{
"type":"null"
}
]
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.ignore":{
"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`,...",
"default":[],
"type":"array",
"items":{
"type":"string"
},
"uniqueItems":true
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.invocationLocation":{
"markdownDescription":"Specifies the working directory for running checks.\n- \"workspace\": run checks for workspaces in the corresponding workspaces' root directories.\n This falls back to \"root\" if `#rust-analyzer.check.invocationStrategy#` is set to `once`.\n- \"root\": run checks in the project's root directory.\nThis config only has an effect when `#rust-analyzer.check.overrideCommand#`\nis set.",
"default":"workspace",
"type":"string",
"enum":[
"workspace",
"root"
],
"enumDescriptions":[
"The command will be executed in the corresponding workspace root.",
"The command will be executed in the project root."
]
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.invocationStrategy":{
"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.",
"default":"per_workspace",
"type":"string",
"enum":[
"per_workspace",
"once"
],
"enumDescriptions":[
"The command will be executed for each workspace.",
"The command will be executed once."
]
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.noDefaultFeatures":{
"markdownDescription":"Whether to pass `--no-default-features` to Cargo. Defaults to\n`#rust-analyzer.cargo.noDefaultFeatures#`.",
"default":null,
"type":[
"null",
"boolean"
]
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.overrideCommand":{
"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#` and\n`#rust-analyzer.check.invocationLocation#`.\n\nIf `$saved_file` is part of the command, rust-analyzer will pass\nthe absolute path of the saved file to the provided command. This is\nintended to be used with non-Cargo build systems.\nNote that `$saved_file` is experimental and may be removed in the future.\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.",
"default":null,
"type":[
"null",
"array"
],
"items":{
"type":"string"
}
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.targets":{
"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\"`.",
"default":null,
"anyOf":[
{
"type":"null"
},
{
"type":"string"
},
{
"type":"array",
"items":{
"type":"string"
}
}
]
}
}
},
{
"title":"check",
"properties":{
"rust-analyzer.check.workspace":{
"markdownDescription":"Whether `--workspace` should be passed to `cargo check`.\nIf false, `-p <package>` will be passed instead.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"completion",
"properties":{
"rust-analyzer.completion.autoimport.enable":{
"markdownDescription":"Toggles the additional completions that automatically add imports when completed.\nNote that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"completion",
"properties":{
"rust-analyzer.completion.autoself.enable":{
"markdownDescription":"Toggles the additional completions that automatically show method calls and field accesses\nwith `self` prefixed to them when inside a method.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"completion",
"properties":{
"rust-analyzer.completion.callable.snippets":{
"markdownDescription":"Whether to add parenthesis and argument snippets when completing function.",
"markdownDescription":"Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position.",
"markdownDescription":"List of rust-analyzer diagnostics to disable.",
"default":[],
"type":"array",
"items":{
"type":"string"
},
"uniqueItems":true
}
}
},
{
"title":"diagnostics",
"properties":{
"rust-analyzer.diagnostics.enable":{
"markdownDescription":"Whether to show native rust-analyzer diagnostics.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"diagnostics",
"properties":{
"rust-analyzer.diagnostics.experimental.enable":{
"markdownDescription":"Whether to show experimental rust-analyzer diagnostics that might\nhave more false positives than usual.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"diagnostics",
"properties":{
"rust-analyzer.diagnostics.remapPrefix":{
"markdownDescription":"Map of prefixes to be substituted when parsing diagnostic file paths.\nThis should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.",
"default":{},
"type":"object"
}
}
},
{
"title":"diagnostics",
"properties":{
"rust-analyzer.diagnostics.styleLints.enable":{
"markdownDescription":"Whether to run additional style lints.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"diagnostics",
"properties":{
"rust-analyzer.diagnostics.warningsAsHint":{
"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\nand will not show up in the `Problems Panel`.",
"default":[],
"type":"array",
"items":{
"type":"string"
}
}
}
},
{
"title":"diagnostics",
"properties":{
"rust-analyzer.diagnostics.warningsAsInfo":{
"markdownDescription":"List of warnings that should be displayed with info severity.\n\nThe warnings will be indicated by a blue squiggly underline in code\nand a blue icon in the `Problems Panel`.",
"default":[],
"type":"array",
"items":{
"type":"string"
}
}
}
},
{
"title":"files",
"properties":{
"rust-analyzer.files.excludeDirs":{
"markdownDescription":"These directories will be ignored by rust-analyzer. They are\nrelative to the workspace root, and globs are not supported. You may\nalso need to add the folders to Code's `files.watcherExclude`.",
"markdownDescription":"Whether to show keyword hover popups. Only applies when\n`#rust-analyzer.hover.documentation.enable#` is set.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.links.enable":{
"markdownDescription":"Use markdown syntax for links on hover.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.memoryLayout.alignment":{
"markdownDescription":"How to render the align information in a memory layout hover.",
"default":"hexadecimal",
"anyOf":[
{
"type":"null"
},
{
"type":"string",
"enum":[
"both",
"decimal",
"hexadecimal"
],
"enumDescriptions":[
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
]
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.memoryLayout.enable":{
"markdownDescription":"Whether to show memory layout data on hover.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.memoryLayout.niches":{
"markdownDescription":"How to render the niche information in a memory layout hover.",
"default":false,
"type":[
"null",
"boolean"
]
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.memoryLayout.offset":{
"markdownDescription":"How to render the offset information in a memory layout hover.",
"default":"hexadecimal",
"anyOf":[
{
"type":"null"
},
{
"type":"string",
"enum":[
"both",
"decimal",
"hexadecimal"
],
"enumDescriptions":[
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
]
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.memoryLayout.size":{
"markdownDescription":"How to render the size information in a memory layout hover.",
"default":"both",
"anyOf":[
{
"type":"null"
},
{
"type":"string",
"enum":[
"both",
"decimal",
"hexadecimal"
],
"enumDescriptions":[
"Render as 12 (0xC)",
"Render as 12",
"Render as 0xC"
]
}
]
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.show.enumVariants":{
"markdownDescription":"How many variants of an enum to display when hovering on. Show none if empty.",
"default":5,
"type":[
"null",
"integer"
],
"minimum":0
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.show.fields":{
"markdownDescription":"How many fields of a struct, variant or union to display when hovering on. Show none if empty.",
"default":5,
"type":[
"null",
"integer"
],
"minimum":0
}
}
},
{
"title":"hover",
"properties":{
"rust-analyzer.hover.show.traitAssocItems":{
"markdownDescription":"How many associated items of a trait to display when hovering a trait.",
"default":null,
"type":[
"null",
"integer"
],
"minimum":0
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.granularity.enforce":{
"markdownDescription":"Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.granularity.group":{
"markdownDescription":"How imports should be grouped into use statements.",
"default":"crate",
"type":"string",
"enum":[
"preserve",
"crate",
"module",
"item",
"one"
],
"enumDescriptions":[
"Do not change the granularity of any imports and preserve the original structure written by the developer.",
"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."
]
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.group.enable":{
"markdownDescription":"Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are separated by newlines.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.merge.glob":{
"markdownDescription":"Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.preferNoStd":{
"markdownDescription":"Prefer to unconditionally use imports of the core and alloc crate, over the std crate.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.preferPrelude":{
"markdownDescription":"Whether to prefer import paths containing a `prelude` module.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"imports",
"properties":{
"rust-analyzer.imports.prefix":{
"markdownDescription":"The path structure for newly inserted paths to use.",
"default":"plain",
"type":"string",
"enum":[
"plain",
"self",
"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":"Whether to show exclusive range inlay hints.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"inlayHints",
"properties":{
"rust-analyzer.inlayHints.reborrowHints.enable":{
"markdownDescription":"Whether to show inlay hints for compiler inserted reborrows.\nThis setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.",
"default":"never",
"type":"string",
"enum":[
"always",
"never",
"mutable"
],
"enumDescriptions":[
"Always show reborrow hints.",
"Never show reborrow hints.",
"Only show mutable reborrow hints."
]
}
}
},
{
"title":"inlayHints",
"properties":{
"rust-analyzer.inlayHints.renderColons":{
"markdownDescription":"Whether to render leading colons for type hints, and trailing colons for parameter hints.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"inlayHints",
"properties":{
"rust-analyzer.inlayHints.typeHints.enable":{
"markdownDescription":"Whether to show inlay type hints for variables.",
"markdownDescription":"Whether to hide inlay type hints for `let` statements that initialize to a closure.\nOnly applies to closures with blocks, same as `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`.",
"markdownDescription":"Whether to show `References` lens for Enum Variants.\nOnly applies when `#rust-analyzer.lens.enable#` is set.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"lens",
"properties":{
"rust-analyzer.lens.references.method.enable":{
"markdownDescription":"Whether to show `Method References` lens. Only applies when\n`#rust-analyzer.lens.enable#` is set.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"lens",
"properties":{
"rust-analyzer.lens.references.trait.enable":{
"markdownDescription":"Whether to show `References` lens for Trait.\nOnly applies when `#rust-analyzer.lens.enable#` is set.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"lens",
"properties":{
"rust-analyzer.lens.run.enable":{
"markdownDescription":"Whether to show `Run` lens. Only applies when\n`#rust-analyzer.lens.enable#` is set.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"general",
"properties":{
"rust-analyzer.linkedProjects":{
"markdownDescription":"Disable project auto-discovery in favor of explicitly specified set\nof projects.\n\nElements must be paths pointing to `Cargo.toml`,\n`rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON\nobjects in `rust-project.json` format.",
"default":[],
"type":"array",
"items":{
"type":[
"string",
"object"
]
}
}
}
},
{
"title":"lru",
"properties":{
"rust-analyzer.lru.capacity":{
"markdownDescription":"Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.",
"markdownDescription":"Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"procMacro",
"properties":{
"rust-analyzer.procMacro.enable":{
"markdownDescription":"Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"procMacro",
"properties":{
"rust-analyzer.procMacro.ignored":{
"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.",
"default":{},
"type":"object"
}
}
},
{
"title":"procMacro",
"properties":{
"rust-analyzer.procMacro.server":{
"markdownDescription":"Internal config, path to proc-macro server executable.",
"default":null,
"type":[
"null",
"string"
]
}
}
},
{
"title":"references",
"properties":{
"rust-analyzer.references.excludeImports":{
"markdownDescription":"Exclude imports from find-all-references.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"references",
"properties":{
"rust-analyzer.references.excludeTests":{
"markdownDescription":"Exclude tests from find-all-references.",
"default":false,
"type":"boolean"
}
}
},
{
"title":"runnables",
"properties":{
"rust-analyzer.runnables.command":{
"markdownDescription":"Command to be executed instead of 'cargo' for runnables.",
"default":null,
"type":[
"null",
"string"
]
}
}
},
{
"title":"runnables",
"properties":{
"rust-analyzer.runnables.extraArgs":{
"markdownDescription":"Additional arguments to be passed to cargo for runnables such as\ntests or binaries. For example, it may be `--release`.",
"default":[],
"type":"array",
"items":{
"type":"string"
}
}
}
},
{
"title":"runnables",
"properties":{
"rust-analyzer.runnables.extraTestBinaryArgs":{
"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).",
"default":[
"--show-output"
],
"type":"array",
"items":{
"type":"string"
}
}
}
},
{
"title":"rustc",
"properties":{
"rust-analyzer.rustc.source":{
"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.",
"default":null,
"type":[
"null",
"string"
]
}
}
},
{
"title":"rustfmt",
"properties":{
"rust-analyzer.rustfmt.extraArgs":{
"markdownDescription":"Additional arguments to `rustfmt`.",
"default":[],
"type":"array",
"items":{
"type":"string"
}
}
}
},
{
"title":"rustfmt",
"properties":{
"rust-analyzer.rustfmt.overrideCommand":{
"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.",
"default":null,
"type":[
"null",
"array"
],
"items":{
"type":"string"
}
}
}
},
{
"title":"rustfmt",
"properties":{
"rust-analyzer.rustfmt.rangeFormatting.enable":{
"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.",
"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.",
"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.",
"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.",
"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.",
"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.",
"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.",
"default":true,
"type":"boolean"
}
}
},
{
"title":"signatureInfo",
"properties":{
"rust-analyzer.signatureInfo.detail":{
"markdownDescription":"Show full signature of the callable. Only shows parameters if disabled.",
"markdownDescription":"Enables automatic discovery of projects using [`DiscoverWorkspaceConfig::command`].\n\n[`DiscoverWorkspaceConfig`] also requires setting `progress_label` and `files_to_watch`.\n`progress_label` is used for the title in progress indicators, whereas `files_to_watch`\nis used to determine which build system-specific files should be watched in order to\nreload rust-analyzer.\n\nBelow is an example of a valid configuration:\n```json\n\"rust-analyzer.workspace.discoverConfig\": {\n \"command\": [\n \"rust-project\",\n \"develop-json\"\n ],\n \"progressLabel\": \"rust-analyzer\",\n \"filesToWatch\": [\n \"BUCK\"\n ]\n}\n```\n\n## On `DiscoverWorkspaceConfig::command`\n\n**Warning**: This format is provisional and subject to change.\n\n[`DiscoverWorkspaceConfig::command`] *must* return a JSON object\ncorresponding to `DiscoverProjectData::Finished`:\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\nAs JSON, `DiscoverProjectData::Finished` is:\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/BUILD\",\n // the contents of a rust-project.json, elided for brevity\n \"project\": {\n \"sysroot\": \"foo\",\n \"crates\": []\n }\n}\n```\n\nIt is encouraged, but not required, to use the other variants on\n`DiscoverProjectData` to provide a more polished end-user experience.\n\n`DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}`,\nwhich will be substituted with the JSON-serialized form of the following\nenum:\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\nThe JSON representation of `DiscoverArgument::Path` is:\n\n```json\n{\n \"path\": \"src/main.rs\"\n}\n```\n\nSimilarly, the JSON representation of `DiscoverArgument::Buildfile` is:\n\n```\n{\n \"buildfile\": \"BUILD\"\n}\n```\n\n`DiscoverArgument::Path` is used to find and generate a `rust-project.json`,\nand therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to\nto update an existing workspace. As a reference for implementors,\nbuck2's `rust-project` will likely be useful:\nhttps://github.com/facebook/buck2/tree/main/integrations/rust-project.",
"markdownDescription":"Workspace symbol search kind.",
"default":"only_types",
"type":"string",
"enum":[
"only_types",
"all_symbols"
],
"enumDescriptions":[
"Search for types only.",
"Search for all symbols kinds."
]
}
}
},
{
"title":"workspace",
"properties":{
"rust-analyzer.workspace.symbol.search.limit":{
"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.",
"default":128,
"type":"integer",
"minimum":0
}
}
},
{
"title":"workspace",
"properties":{
"rust-analyzer.workspace.symbol.search.scope":{
"markdownDescription":"Workspace symbol search scope.",
"description":"A brief introduction to get started with rust-analyzer. Learn about key features and resources to help you get the most out of the extension.",
"description":"There are a couple of things you might want to configure upfront to your tastes. We'll name a few here but be sure to check out the docs linked below!\n\n**Marking library sources as readonly**\n\nAdding the following to your settings.json will mark all Rust library sources as readonly:\n```json\n\"files.readonlyInclude\": {\n \"**/.cargo/registry/src/**/*.rs\": true,\n \"**/lib/rustlib/src/rust/library/**/*.rs\": true,\n},\n```\n\n**Check on Save**\n\nBy default, rust-analyzer will run `cargo check` on your codebase when you save a file, rendering diagnostics emitted by `cargo check` within your code. This can potentially collide with other `cargo` commands running concurrently, blocking them from running for a certain amount of time. In these cases it is recommended to disable the `rust-analyzer.checkOnSave` configuration and running the `rust-analyzer: Run flycheck` command on-demand instead.",
"description":"Confused about configurations? Want to learn more about rust-analyzer? Visit the [User Manual](https://rust-analyzer.github.io/manual.html)!",
"description":"What are these code hints that are being inserted into my code?\n\nThese hints are called inlay hints which rust-analyzer support and are enabled by default in VSCode. If you wish to disable them you can do so via the `editor.inlayHints.enabled` setting.",