2021-02-01
Rust Analyzer Options
type: ['null', 'string']
Custom
cargo runner extension ID.
anyOf:
{'type': 'null'}
{'type': 'array', 'items': {'type': 'object', 'properties': {'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"}'}
Environment variables passed to the runnable launched using
Test
or Debug
lens or
rust-analyzer.run
command.
type: boolean
default: True
Whether to show inlay
hints.
type: string
default: stable
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.
value | description |
---|---|
stable | stable updates are shipped
weekly, they don’t contain cutting-edge features from VSCode proposed
APIs but have less bugs in general. |
nightly | 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. |
type: boolean
default: True
Whether to ask for
permission before downloading any files from the Internet.
type: ['null', 'string']
Path to
rust-analyzer executable (points to bundled binary by default). If this
is set, then #rust-analyzer.updates.channel#
setting is not
used
type: ['null', 'object']
Extra
environment variables that will be passed to the rust-analyzer
executable. Useful for passing e.g. RA_LOG
for
debugging.
type: string
default: off
Trace requests to the
rust-analyzer (this is usually overly verbose and not recommended for
regular users).
value | description |
---|---|
off | No traces |
messages | Error only |
verbose | Full log |
key | value |
---|---|
scope | window |
type: boolean
default: False
Enable logging of VS
Code extensions itself.
type: string
default: auto
Preferred debug
engine.
value | description |
---|---|
auto | First try to use CodeLLDB, if it’s not installed try to use MS C++ tools. |
vadimcn.vscode-lldb | Use CodeLLDB |
ms-vscode.cpptools | Use MS C++ tools |
type: object
default:
{
"/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"
}
Optional source file mappings passed to the debug engine.
type: boolean
default: False
Whether to open up the
Debug Panel
on debugging start.
type: object
default: {}
Optional settings passed
to the debug engine. Example:
{ "lldb": { "terminal":"external"} }
type: string
default: full
The strategy to use
when inserting new imports or merging imports.
value | description |
---|---|
none | No merging |
full | Merge all layers of the import trees |
last | Only merge the last layer of the import trees |
type: string
default: plain
The path structure for
newly inserted paths to use.
value | description |
---|---|
plain | Insert import paths relative to the
current module, using up to one super prefix if the parent
module contains the requested item. |
by_self | Prefix all import paths with
self if they don’t begin with self ,
super , crate or a crate name. |
by_crate | Force import paths to be absolute by
always starting them with crate or the crate name they
refer to. |
type: boolean
default: True
Show function name and
docs in parameter hints.
type: boolean
default: True
Automatically refresh
project info via cargo metadata
on Cargo.toml
changes.
type: boolean
default: False
Activate all available
features (--all-features
).
type: array
default: []
List of features to
activate.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: boolean
default: False
Run
cargo check
on startup to get the correct value for package
OUT_DIRs.
type: boolean
default: False
Do not activate the
default
feature.
type: ['null', 'string']
Compilation target (target triple).
type: boolean
default: False
Internal config for
debugging, disables loading of sysroot crates.
type: boolean
default: True
Run specified
cargo check
command for diagnostics on save.
type: ['null', 'boolean']
Check
with all features (--all-features
). Defaults to
#rust-analyzer.cargo.allFeatures#
.
type: boolean
default: True
Check all targets and
tests (--all-targets
).
type: string
default: check
Cargo command to use
for cargo check
.
type: ['null', 'boolean']
Do not
activate the default
feature.
type: ['null', 'string']
Check for
a specific target. Defaults to
#rust-analyzer.cargo.target#
.
type: array
default: []
Extra arguments for
cargo check
.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: ['null', 'array']
List of
features to activate. Defaults to
#rust-analyzer.cargo.features#
.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: ['null', 'array']
Advanced
option, fully override the command rust-analyzer uses for checking. The
command should include --message-format=json
or similar
option.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: boolean
default: True
Whether to add argument
snippets when completing functions.
type: boolean
default: True
Whether to add
parenthesis when completing functions.
type: boolean
default: True
Whether to show postfix
snippets like dbg
, if
, not
,
etc.
type: boolean
default: True
Toggles the additional
completions that automatically add imports when completed. Note that
your client must specify the additionalTextEdits
LSP client
capability to truly have this feature enabled.
type: boolean
default: True
Whether to show native
rust-analyzer diagnostics.
type: boolean
default: True
Whether to show
experimental rust-analyzer diagnostics that might have more false
positives than usual.
type: array
default: []
List of rust-analyzer
diagnostics to disable.
key | value |
---|---|
items | {‘type’: ‘string’} |
uniqueItems | True |
type: array
default: []
List of warnings that
should be displayed with info severity.warnings will be indicated by a
blue squiggly underline in code and a blue icon in the
Problems Panel
.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: array
default: []
List of warnings that
should be displayed with hint severity.warnings will be indicated by
faded text or three dots in code and will not show up in the
Problems Panel
.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: string
default: client
Controls file
watching implementation.
type: array
default: []
These directories will be
ignored by rust-analyzer.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: boolean
default: True
Whether to show
Debug
action. Only applies when
#rust-analyzer.hoverActions.enable#
is set.
type: boolean
default: True
Whether to show
HoverActions in Rust files.
type: boolean
default: True
Whether to show
Go to Type Definition
action. Only applies when
#rust-analyzer.hoverActions.enable#
is set.
type: boolean
default: True
Whether to show
Implementations
action. Only applies when
#rust-analyzer.hoverActions.enable#
is set.
type: boolean
default: True
Whether to show
Run
action. Only applies when
#rust-analyzer.hoverActions.enable#
is set.
type: boolean
default: True
Use markdown syntax for
links in hover.
type: boolean
default: True
Whether to show inlay
type hints for method chains.
type: ['null', 'integer']
minimum: 0
Maximum length for inlay
hints. Default is unlimited.
type: boolean
default: True
Whether to show
function parameter name inlay hints at the call site.
type: boolean
default: True
Whether to show inlay
type hints for variables.
type: boolean
default: True
Whether to show
Debug
lens. Only applies when
#rust-analyzer.lens.enable#
is set.
type: boolean
default: True
Whether to show
CodeLens in Rust files.
type: boolean
default: True
Whether to show
Implementations
lens. Only applies when
#rust-analyzer.lens.enable#
is set.
type: boolean
default: True
Whether to show
Run
lens. Only applies when
#rust-analyzer.lens.enable#
is set.
type: boolean
default: False
Whether to show
Method References
lens. Only applies when
#rust-analyzer.lens.enable#
is set.
type: boolean
default: False
Whether to show
References
lens. Only applies when
#rust-analyzer.lens.enable#
is set.
type: array
default: []
Disable project
auto-discovery in favor of explicitly specified set of projects.must be
paths pointing to Cargo.toml
,
rust-project.json
, or JSON objects in
rust-project.json
format.
key | value |
---|---|
items | {‘type’: [‘string’, ‘object’]} |
type: ['null', 'integer']
minimum: 0
Number of syntax trees
rust-analyzer keeps in memory. Defaults to 128.
type: boolean
default: True
Whether to show
can't find Cargo.toml
error message.
type: boolean
default: False
Enable Proc macro
support, #rust-analyzer.cargo.loadOutDirsFromCheck#
must be
enabled.
type: ['null', 'string']
Internal
config, path to proc-macro server executable (typically, this is
rust-analyzer itself, but we override this in tests).
type: ['null', 'string']
Command
to be executed instead of ‘cargo’ for runnables.
type: array
default: []
Additional arguments to
be passed to cargo for runnables such as tests or binaries.example, it
may be --release
.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: ['null', 'string']
Path to
the rust compiler sources, for usage in rustc_private projects.
type: array
default: []
Additional arguments to
rustfmt
.
key | value |
---|---|
items | {‘type’: ‘string’} |
type: ['null', 'array']
Advanced
option, fully override the command rust-analyzer uses for
formatting.
key | value |
---|---|
items | {‘type’: ‘string’} |