Reference Documentation for Rust Analyzer Options

2020-04-20

Rust Analyzer Options

TOC

Rust Analyzer

Rust Analyzer {#configuration_Rust Analyzer}

rust-analyzer.diagnostics.enable

type: boolean
default: True
Whether to show native rust-analyzer diagnostics.

rust-analyzer.lruCapacity

type: ['null', 'integer']
minimum: 0
Number of syntax trees rust-analyzer keeps in memory.

key value
exclusiveMinimum True

rust-analyzer.files.watcher

type: string
default: client
Controls file watching implementation.

key value
enum [‘client’, ‘notify’]

rust-analyzer.files.exclude

type: array
default: []
Paths to exclude from analysis.

key value
items {‘type’: ‘string’}

rust-analyzer.notifications.workspaceLoaded

type: boolean
default: True
Whether to show workspace loaded message.

rust-analyzer.notifications.cargoTomlNotFound

type: boolean
default: True
Whether to show can't find Cargo.toml error message

rust-analyzer.cargo.noDefaultFeatures

type: boolean
default: False
Do not activate the default feature

rust-analyzer.cargo.allFeatures

type: boolean
default: True
Activate all available features

rust-analyzer.cargo.features

type: array
default: []
List of features to activate

key value
items {‘type’: ‘string’}

rust-analyzer.cargo.loadOutDirsFromCheck

type: boolean
default: False
Run cargo check on startup to get the correct value for package OUT_DIRs

rust-analyzer.rustfmt.extraArgs

type: array
default: []
Additional arguments to rustfmt

key value
items {‘type’: ‘string’}

rust-analyzer.rustfmt.overrideCommand

type: ['null', 'array']
Advanced option, fully override the command rust-analyzer uses for formatting.

key value
items {‘type’: ‘string’, ‘minItems’: 1}

rust-analyzer.checkOnSave.enable

type: boolean
default: True
Run specified cargo check command for diagnostics on save

rust-analyzer.checkOnSave.extraArgs

type: array
default: []
Extra arguments for cargo check

key value
items {‘type’: ‘string’}

rust-analyzer.checkOnSave.command

type: string
default: check
Cargo command to use for cargo check

rust-analyzer.checkOnSave.overrideCommand

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’, ‘minItems’: 1}

rust-analyzer.checkOnSave.allTargets

type: boolean
default: True
Check all targets and tests (will be passed as --all-targets)

rust-analyzer.inlayHints.typeHints

type: boolean
default: True
Whether to show inlay type hints

rust-analyzer.inlayHints.chainingHints

type: boolean
default: True
Whether to show inlay type hints for method chains

rust-analyzer.inlayHints.parameterHints

type: boolean
default: True
Whether to show function parameter name inlay hints at the call site

rust-analyzer.inlayHints.maxLength

type: ['null', 'integer']
default: 20
minimum: 0
Maximum length for inlay hints

key value
exclusiveMinimum True

rust-analyzer.completion.addCallParenthesis

type: boolean
default: True
Whether to add parenthesis when completing functions

rust-analyzer.completion.addCallArgumentSnippets

type: boolean
default: True
Whether to add argument snippets when completing functions

rust-analyzer.completion.postfix.enable

type: boolean
default: True
Whether to show postfix snippets like dbg, if, not, etc.

rust-analyzer.callInfo.full

type: boolean
default: True
Show function name and docs in parameter hints

rust-analyzer.updates.channel

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

possible values

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

rust-analyzer.updates.askBeforeDownload

type: boolean
default: True
Whether to ask for permission before downloading any files from the Internet

rust-analyzer.serverPath

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

rust-analyzer.trace.server

type: string
default: off
Trace requests to the rust-analyzer

possible values

value description
off No traces
messages Error only
verbose Full log
key value
scope window

rust-analyzer.trace.extension

type: boolean
default: False
Enable logging of VS Code extensions itself

rust-analyzer.procMacro.enabled

type: boolean
default: False
Enable Proc macro support, cargo.loadOutDirsFromCheck must be enabled.