Merge pull request #20154 from joshka/jm/improve-setting-titles

Improve settings tree title and descriptions
This commit is contained in:
Lukas Wirth 2025-07-29 10:42:07 +00:00 committed by GitHub
commit c12ec2e062
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 906 additions and 631 deletions

View file

@ -61,231 +61,310 @@ pub enum MaxSubstitutionLength {
Limit(usize), Limit(usize),
} }
// Defines the server-side configuration of the rust-analyzer. We generate // Defines the server-side configuration of the rust-analyzer. We generate *parts* of VS Code's
// *parts* of VS Code's `package.json` config from this. Run `cargo test` to // `package.json` config from this. Run `cargo test` to re-generate that file.
// re-generate that file.
// //
// However, editor specific config, which the server doesn't know about, should // However, editor specific config, which the server doesn't know about, should be specified
// be specified directly in `package.json`. // directly in `package.json`.
// //
// To deprecate an option by replacing it with another name use `new_name` | `old_name` so that we keep // To deprecate an option by replacing it with another name use `new_name` | `old_name` so that we
// parsing the old name. // keep parsing the old name.
config_data! { config_data! {
/// Configs that apply on a workspace-wide scope. There are 2 levels on which a global configuration can be configured /// Configs that apply on a workspace-wide scope. There are 2 levels on which a global
/// configuration can be configured
/// ///
/// 1. `rust-analyzer.toml` file under user's config directory (e.g ~/.config/rust-analyzer/rust-analyzer.toml) /// 1. `rust-analyzer.toml` file under user's config directory (e.g
/// ~/.config/rust-analyzer/rust-analyzer.toml)
/// 2. Client's own configurations (e.g `settings.json` on VS Code) /// 2. Client's own configurations (e.g `settings.json` on VS Code)
/// ///
/// A config is searched for by traversing a "config tree" in a bottom up fashion. It is chosen by the nearest first principle. /// A config is searched for by traversing a "config tree" in a bottom up fashion. It is chosen
/// by the nearest first principle.
global: struct GlobalDefaultConfigData <- GlobalConfigInput -> { global: struct GlobalDefaultConfigData <- GlobalConfigInput -> {
/// Warm up caches on project load. /// Warm up caches on project load.
cachePriming_enable: bool = true, cachePriming_enable: bool = true,
/// How many worker threads to handle priming caches. The default `0` means to pick automatically.
/// How many worker threads to handle priming caches. The default `0` means to pick
/// automatically.
cachePriming_numThreads: NumThreads = NumThreads::Physical, cachePriming_numThreads: NumThreads = NumThreads::Physical,
/// Custom completion snippets. /// Custom completion snippets.
completion_snippets_custom: FxIndexMap<String, SnippetDef> = Config::completion_snippets_default(), completion_snippets_custom: FxIndexMap<String, SnippetDef> =
Config::completion_snippets_default(),
/// List of files to ignore
/// These paths (file/directories) will be ignored by rust-analyzer. They are ///
/// relative to the workspace root, and globs are not supported. You may /// These paths (file/directories) will be ignored by rust-analyzer. They are relative to
/// also need to add the folders to Code's `files.watcherExclude`. /// the workspace root, and globs are not supported. You may also need to add the folders to
/// Code's `files.watcherExclude`.
files_exclude | files_excludeDirs: Vec<Utf8PathBuf> = vec![], files_exclude | files_excludeDirs: Vec<Utf8PathBuf> = vec![],
/// Highlight related return values while the cursor is on any `match`, `if`, or match arm
/// arrow (`=>`).
/// Enables highlighting of related return values while the cursor is on any `match`, `if`, or match arm arrow (`=>`).
highlightRelated_branchExitPoints_enable: bool = true, highlightRelated_branchExitPoints_enable: bool = true,
/// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
/// Highlight related references while the cursor is on `break`, `loop`, `while`, or `for`
/// keywords.
highlightRelated_breakPoints_enable: bool = true, highlightRelated_breakPoints_enable: bool = true,
/// Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure.
/// Highlight all captures of a closure while the cursor is on the `|` or move keyword of a closure.
highlightRelated_closureCaptures_enable: bool = true, highlightRelated_closureCaptures_enable: bool = true,
/// Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).
/// Highlight all exit points while the cursor is on any `return`, `?`, `fn`, or return type
/// arrow (`->`).
highlightRelated_exitPoints_enable: bool = true, highlightRelated_exitPoints_enable: bool = true,
/// Enables highlighting of related references while the cursor is on any identifier.
/// Highlight related references while the cursor is on any identifier.
highlightRelated_references_enable: bool = true, highlightRelated_references_enable: bool = true,
/// Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords.
/// Highlight all break points for a loop or block context while the cursor is on any
/// `async` or `await` keywords.
highlightRelated_yieldPoints_enable: bool = true, highlightRelated_yieldPoints_enable: bool = true,
/// Whether to show `Debug` action. Only applies when /// Show `Debug` action. Only applies when `#rust-analyzer.hover.actions.enable#` is set.
/// `#rust-analyzer.hover.actions.enable#` is set.
hover_actions_debug_enable: bool = true, hover_actions_debug_enable: bool = true,
/// Whether to show HoverActions in Rust files.
/// Show HoverActions in Rust files.
hover_actions_enable: bool = true, hover_actions_enable: bool = true,
/// Whether to show `Go to Type Definition` action. Only applies when
/// Show `Go to Type Definition` action. Only applies when
/// `#rust-analyzer.hover.actions.enable#` is set. /// `#rust-analyzer.hover.actions.enable#` is set.
hover_actions_gotoTypeDef_enable: bool = true, hover_actions_gotoTypeDef_enable: bool = true,
/// Whether to show `Implementations` action. Only applies when
/// `#rust-analyzer.hover.actions.enable#` is set. /// Show `Implementations` action. Only applies when `#rust-analyzer.hover.actions.enable#`
/// is set.
hover_actions_implementations_enable: bool = true, hover_actions_implementations_enable: bool = true,
/// Whether to show `References` action. Only applies when
/// `#rust-analyzer.hover.actions.enable#` is set. /// Show `References` action. Only applies when `#rust-analyzer.hover.actions.enable#` is
/// set.
hover_actions_references_enable: bool = false, hover_actions_references_enable: bool = false,
/// Whether to show `Run` action. Only applies when
/// `#rust-analyzer.hover.actions.enable#` is set. /// Show `Run` action. Only applies when `#rust-analyzer.hover.actions.enable#` is set.
hover_actions_run_enable: bool = true, hover_actions_run_enable: bool = true,
/// Whether to show `Update Test` action. Only applies when
/// `#rust-analyzer.hover.actions.enable#` and `#rust-analyzer.hover.actions.run.enable#` are set. /// Show `Update Test` action. Only applies when `#rust-analyzer.hover.actions.enable#` and
/// `#rust-analyzer.hover.actions.run.enable#` are set.
hover_actions_updateTest_enable: bool = true, hover_actions_updateTest_enable: bool = true,
/// Whether to show documentation on hover. /// Show documentation on hover.
hover_documentation_enable: bool = true, hover_documentation_enable: bool = true,
/// Whether to show keyword hover popups. Only applies when
/// Show keyword hover popups. Only applies when
/// `#rust-analyzer.hover.documentation.enable#` is set. /// `#rust-analyzer.hover.documentation.enable#` is set.
hover_documentation_keywords_enable: bool = true, hover_documentation_keywords_enable: bool = true,
/// Whether to show drop glue information on hover.
/// Show drop glue information on hover.
hover_dropGlue_enable: bool = true, hover_dropGlue_enable: bool = true,
/// Use markdown syntax for links on hover. /// Use markdown syntax for links on hover.
hover_links_enable: bool = true, hover_links_enable: bool = true,
/// Whether to show what types are used as generic arguments in calls etc. on hover, and what is their max length to show such types, beyond it they will be shown with ellipsis.
/// Show what types are used as generic arguments in calls etc. on hover, and limit the max
/// length to show such types, beyond which they will be shown with ellipsis.
/// ///
/// This can take three values: `null` means "unlimited", the string `"hide"` means to not show generic substitutions at all, and a number means to limit them to X characters. /// This can take three values: `null` means "unlimited", the string `"hide"` means to not
/// show generic substitutions at all, and a number means to limit them to X characters.
/// ///
/// The default is 20 characters. /// The default is 20 characters.
hover_maxSubstitutionLength: Option<MaxSubstitutionLength> = Some(MaxSubstitutionLength::Limit(20)), hover_maxSubstitutionLength: Option<MaxSubstitutionLength> =
Some(MaxSubstitutionLength::Limit(20)),
/// How to render the align information in a memory layout hover. /// How to render the align information in a memory layout hover.
hover_memoryLayout_alignment: Option<MemoryLayoutHoverRenderKindDef> = Some(MemoryLayoutHoverRenderKindDef::Hexadecimal), hover_memoryLayout_alignment: Option<MemoryLayoutHoverRenderKindDef> =
/// Whether to show memory layout data on hover. Some(MemoryLayoutHoverRenderKindDef::Hexadecimal),
/// Show memory layout data on hover.
hover_memoryLayout_enable: bool = true, hover_memoryLayout_enable: bool = true,
/// How to render the niche information in a memory layout hover. /// How to render the niche information in a memory layout hover.
hover_memoryLayout_niches: Option<bool> = Some(false), hover_memoryLayout_niches: Option<bool> = Some(false),
/// How to render the offset information in a memory layout hover. /// How to render the offset information in a memory layout hover.
hover_memoryLayout_offset: Option<MemoryLayoutHoverRenderKindDef> = Some(MemoryLayoutHoverRenderKindDef::Hexadecimal), hover_memoryLayout_offset: Option<MemoryLayoutHoverRenderKindDef> =
Some(MemoryLayoutHoverRenderKindDef::Hexadecimal),
/// How to render the padding information in a memory layout hover. /// How to render the padding information in a memory layout hover.
hover_memoryLayout_padding: Option<MemoryLayoutHoverRenderKindDef> = None, hover_memoryLayout_padding: Option<MemoryLayoutHoverRenderKindDef> = None,
/// How to render the size information in a memory layout hover. /// How to render the size information in a memory layout hover.
hover_memoryLayout_size: Option<MemoryLayoutHoverRenderKindDef> = Some(MemoryLayoutHoverRenderKindDef::Both), hover_memoryLayout_size: Option<MemoryLayoutHoverRenderKindDef> =
Some(MemoryLayoutHoverRenderKindDef::Both),
/// How many variants of an enum to display when hovering on. Show none if empty. /// How many variants of an enum to display when hovering on. Show none if empty.
hover_show_enumVariants: Option<usize> = Some(5), hover_show_enumVariants: Option<usize> = Some(5),
/// How many fields of a struct, variant or union to display when hovering on. Show none if empty.
/// How many fields of a struct, variant or union to display when hovering on. Show none if
/// empty.
hover_show_fields: Option<usize> = Some(5), hover_show_fields: Option<usize> = Some(5),
/// How many associated items of a trait to display when hovering a trait. /// How many associated items of a trait to display when hovering a trait.
hover_show_traitAssocItems: Option<usize> = None, hover_show_traitAssocItems: Option<usize> = None,
/// Whether to show inlay type hints for binding modes. /// Show inlay type hints for binding modes.
inlayHints_bindingModeHints_enable: bool = false, inlayHints_bindingModeHints_enable: bool = false,
/// Whether to show inlay type hints for method chains.
/// Show inlay type hints for method chains.
inlayHints_chainingHints_enable: bool = true, inlayHints_chainingHints_enable: bool = true,
/// Whether to show inlay hints after a closing `}` to indicate what item it belongs to.
/// Show inlay hints after a closing `}` to indicate what item it belongs to.
inlayHints_closingBraceHints_enable: bool = true, inlayHints_closingBraceHints_enable: bool = true,
/// Minimum number of lines required before the `}` until the hint is shown (set to 0 or 1 /// Minimum number of lines required before the `}` until the hint is shown (set to 0 or 1
/// to always show them). /// to always show them).
inlayHints_closingBraceHints_minLines: usize = 25, inlayHints_closingBraceHints_minLines: usize = 25,
/// Whether to show inlay hints for closure captures.
/// Show inlay hints for closure captures.
inlayHints_closureCaptureHints_enable: bool = false, inlayHints_closureCaptureHints_enable: bool = false,
/// Whether to show inlay type hints for return types of closures.
inlayHints_closureReturnTypeHints_enable: ClosureReturnTypeHintsDef = ClosureReturnTypeHintsDef::Never, /// Show inlay type hints for return types of closures.
inlayHints_closureReturnTypeHints_enable: ClosureReturnTypeHintsDef =
ClosureReturnTypeHintsDef::Never,
/// Closure notation in type and chaining inlay hints. /// Closure notation in type and chaining inlay hints.
inlayHints_closureStyle: ClosureStyle = ClosureStyle::ImplFn, inlayHints_closureStyle: ClosureStyle = ClosureStyle::ImplFn,
/// Whether to show enum variant discriminant hints.
inlayHints_discriminantHints_enable: DiscriminantHintsDef = DiscriminantHintsDef::Never, /// Show enum variant discriminant hints.
/// Whether to show inlay hints for type adjustments. inlayHints_discriminantHints_enable: DiscriminantHintsDef =
inlayHints_expressionAdjustmentHints_enable: AdjustmentHintsDef = AdjustmentHintsDef::Never, DiscriminantHintsDef::Never,
/// Whether to hide inlay hints for type adjustments outside of `unsafe` blocks.
/// Show inlay hints for type adjustments.
inlayHints_expressionAdjustmentHints_enable: AdjustmentHintsDef =
AdjustmentHintsDef::Never,
/// Hide inlay hints for type adjustments outside of `unsafe` blocks.
inlayHints_expressionAdjustmentHints_hideOutsideUnsafe: bool = false, inlayHints_expressionAdjustmentHints_hideOutsideUnsafe: bool = false,
/// Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc).
inlayHints_expressionAdjustmentHints_mode: AdjustmentHintsModeDef = AdjustmentHintsModeDef::Prefix, /// Show inlay hints as postfix ops (`.*` instead of `*`, etc).
/// Whether to show const generic parameter name inlay hints. inlayHints_expressionAdjustmentHints_mode: AdjustmentHintsModeDef =
inlayHints_genericParameterHints_const_enable: bool= true, AdjustmentHintsModeDef::Prefix,
/// Whether to show generic lifetime parameter name inlay hints.
/// Show const generic parameter name inlay hints.
inlayHints_genericParameterHints_const_enable: bool = true,
/// Show generic lifetime parameter name inlay hints.
inlayHints_genericParameterHints_lifetime_enable: bool = false, inlayHints_genericParameterHints_lifetime_enable: bool = false,
/// Whether to show generic type parameter name inlay hints.
/// Show generic type parameter name inlay hints.
inlayHints_genericParameterHints_type_enable: bool = false, inlayHints_genericParameterHints_type_enable: bool = false,
/// Whether to show implicit drop hints.
/// Show implicit drop hints.
inlayHints_implicitDrops_enable: bool = false, inlayHints_implicitDrops_enable: bool = false,
/// Whether to show inlay hints for the implied type parameter `Sized` bound.
/// Show inlay hints for the implied type parameter `Sized` bound.
inlayHints_implicitSizedBoundHints_enable: bool = false, inlayHints_implicitSizedBoundHints_enable: bool = false,
/// Whether to show inlay type hints for elided lifetimes in function signatures.
/// Show inlay type hints for elided lifetimes in function signatures.
inlayHints_lifetimeElisionHints_enable: LifetimeElisionDef = LifetimeElisionDef::Never, inlayHints_lifetimeElisionHints_enable: LifetimeElisionDef = LifetimeElisionDef::Never,
/// Whether to prefer using parameter names as the name for elided lifetime hints if possible.
/// Prefer using parameter names as the name for elided lifetime hints if possible.
inlayHints_lifetimeElisionHints_useParameterNames: bool = false, inlayHints_lifetimeElisionHints_useParameterNames: bool = false,
/// Maximum length for inlay hints. Set to null to have an unlimited length. /// Maximum length for inlay hints. Set to null to have an unlimited length.
inlayHints_maxLength: Option<usize> = Some(25), inlayHints_maxLength: Option<usize> = Some(25),
/// Whether to show function parameter name inlay hints at the call
/// site. /// Show function parameter name inlay hints at the call site.
inlayHints_parameterHints_enable: bool = true, inlayHints_parameterHints_enable: bool = true,
/// Whether to show exclusive range inlay hints.
/// Show exclusive range inlay hints.
inlayHints_rangeExclusiveHints_enable: bool = false, inlayHints_rangeExclusiveHints_enable: bool = false,
/// Whether to show inlay hints for compiler inserted reborrows.
/// This setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#. /// Show inlay hints for compiler inserted reborrows.
///
/// This setting is deprecated in favor of
/// #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.
inlayHints_reborrowHints_enable: ReborrowHintsDef = ReborrowHintsDef::Never, inlayHints_reborrowHints_enable: ReborrowHintsDef = ReborrowHintsDef::Never,
/// Whether to render leading colons for type hints, and trailing colons for parameter hints. /// Whether to render leading colons for type hints, and trailing colons for parameter hints.
inlayHints_renderColons: bool = true, inlayHints_renderColons: bool = true,
/// Whether to show inlay type hints for variables.
/// Show inlay type hints for variables.
inlayHints_typeHints_enable: bool = true, inlayHints_typeHints_enable: bool = true,
/// Whether to hide inlay type hints for `let` statements that initialize to a closure.
/// Only applies to closures with blocks, same as `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`. /// Hide inlay type hints for `let` statements that initialize to a closure.
///
/// Only applies to closures with blocks, same as
/// `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`.
inlayHints_typeHints_hideClosureInitialization: bool = false, inlayHints_typeHints_hideClosureInitialization: bool = false,
/// Whether to hide inlay parameter type hints for closures.
inlayHints_typeHints_hideClosureParameter:bool = false, /// Hide inlay parameter type hints for closures.
/// Whether to hide inlay type hints for constructors. inlayHints_typeHints_hideClosureParameter: bool = false,
/// Hide inlay type hints for constructors.
inlayHints_typeHints_hideNamedConstructor: bool = false, inlayHints_typeHints_hideNamedConstructor: bool = false,
/// Enables the experimental support for interpreting tests. /// Enable the experimental support for interpreting tests.
interpret_tests: bool = false, interpret_tests: bool = false,
/// Join lines merges consecutive declaration and initialization of an assignment. /// Join lines merges consecutive declaration and initialization of an assignment.
joinLines_joinAssignments: bool = true, joinLines_joinAssignments: bool = true,
/// Join lines inserts else between consecutive ifs. /// Join lines inserts else between consecutive ifs.
joinLines_joinElseIf: bool = true, joinLines_joinElseIf: bool = true,
/// Join lines removes trailing commas. /// Join lines removes trailing commas.
joinLines_removeTrailingComma: bool = true, joinLines_removeTrailingComma: bool = true,
/// Join lines unwraps trivial blocks. /// Join lines unwraps trivial blocks.
joinLines_unwrapTrivialBlock: bool = true, joinLines_unwrapTrivialBlock: bool = true,
/// Whether to show `Debug` lens. Only applies when /// Show `Debug` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
/// `#rust-analyzer.lens.enable#` is set.
lens_debug_enable: bool = true, lens_debug_enable: bool = true,
/// Whether to show CodeLens in Rust files.
/// Show CodeLens in Rust files.
lens_enable: bool = true, lens_enable: bool = true,
/// Whether to show `Implementations` lens. Only applies when
/// `#rust-analyzer.lens.enable#` is set. /// Show `Implementations` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
lens_implementations_enable: bool = true, lens_implementations_enable: bool = true,
/// Where to render annotations. /// Where to render annotations.
lens_location: AnnotationLocation = AnnotationLocation::AboveName, lens_location: AnnotationLocation = AnnotationLocation::AboveName,
/// Whether to show `References` lens for Struct, Enum, and Union.
/// Only applies when `#rust-analyzer.lens.enable#` is set. /// Show `References` lens for Struct, Enum, and Union. Only applies when
/// `#rust-analyzer.lens.enable#` is set.
lens_references_adt_enable: bool = false, lens_references_adt_enable: bool = false,
/// Whether to show `References` lens for Enum Variants.
/// Only applies when `#rust-analyzer.lens.enable#` is set. /// Show `References` lens for Enum Variants. Only applies when
/// `#rust-analyzer.lens.enable#` is set.
lens_references_enumVariant_enable: bool = false, lens_references_enumVariant_enable: bool = false,
/// Whether to show `Method References` lens. Only applies when
/// `#rust-analyzer.lens.enable#` is set. /// Show `Method References` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
lens_references_method_enable: bool = false, lens_references_method_enable: bool = false,
/// Whether to show `References` lens for Trait.
/// Only applies when `#rust-analyzer.lens.enable#` is set. /// Show `References` lens for Trait. Only applies when `#rust-analyzer.lens.enable#` is
/// set.
lens_references_trait_enable: bool = false, lens_references_trait_enable: bool = false,
/// Whether to show `Run` lens. Only applies when
/// `#rust-analyzer.lens.enable#` is set. /// Show `Run` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
lens_run_enable: bool = true, lens_run_enable: bool = true,
/// Whether to show `Update Test` lens. Only applies when
/// `#rust-analyzer.lens.enable#` and `#rust-analyzer.lens.run.enable#` are set. /// Show `Update Test` lens. Only applies when `#rust-analyzer.lens.enable#` and
/// `#rust-analyzer.lens.run.enable#` are set.
lens_updateTest_enable: bool = true, lens_updateTest_enable: bool = true,
/// Disable project auto-discovery in favor of explicitly specified set /// Disable project auto-discovery in favor of explicitly specified set of projects.
/// of projects.
/// ///
/// Elements must be paths pointing to `Cargo.toml`, /// Elements must be paths pointing to `Cargo.toml`, `rust-project.json`, `.rs` files (which
/// `rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON /// will be treated as standalone files) or JSON objects in `rust-project.json` format.
/// objects in `rust-project.json` format.
linkedProjects: Vec<ManifestOrProjectJson> = vec![], linkedProjects: Vec<ManifestOrProjectJson> = vec![],
/// Number of syntax trees rust-analyzer keeps in memory. Defaults to 128. /// Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
lru_capacity: Option<u16> = None, lru_capacity: Option<u16> = None,
/// Sets the LRU capacity of the specified queries.
/// The LRU capacity of the specified queries.
lru_query_capacities: FxHashMap<Box<str>, u16> = FxHashMap::default(), lru_query_capacities: FxHashMap<Box<str>, u16> = FxHashMap::default(),
/// Whether to show `can't find Cargo.toml` error message. /// Show `can't find Cargo.toml` error message.
notifications_cargoTomlNotFound: bool = true, notifications_cargoTomlNotFound: bool = true,
/// How many worker threads in the main loop. The default `null` means to pick automatically. /// The number of worker threads in the main loop. The default `null` means to pick
/// automatically.
numThreads: Option<NumThreads> = None, numThreads: Option<NumThreads> = None,
/// Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set. /// Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set.
procMacro_attributes_enable: bool = true, procMacro_attributes_enable: bool = true,
/// Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`. /// Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`.
procMacro_enable: bool = true, procMacro_enable: bool = true,
/// Internal config, path to proc-macro server executable. /// Internal config, path to proc-macro server executable.
procMacro_server: Option<Utf8PathBuf> = None, procMacro_server: Option<Utf8PathBuf> = None,
@ -300,31 +379,41 @@ config_data! {
/// When enabled, rust-analyzer will highlight rust source in doc comments as well as intra /// When enabled, rust-analyzer will highlight rust source in doc comments as well as intra
/// doc links. /// doc links.
semanticHighlighting_doc_comment_inject_enable: bool = true, semanticHighlighting_doc_comment_inject_enable: bool = true,
/// Whether the server is allowed to emit non-standard tokens and modifiers.
/// Emit non-standard tokens and modifiers
///
/// When enabled, rust-analyzer will emit tokens and modifiers that are not part of the
/// standard set of semantic tokens.
semanticHighlighting_nonStandardTokens: bool = true, semanticHighlighting_nonStandardTokens: bool = true,
/// Use semantic tokens for operators. /// Use semantic tokens for operators.
/// ///
/// When disabled, rust-analyzer will emit semantic tokens only for operator tokens when /// When disabled, rust-analyzer will emit semantic tokens only for operator tokens when
/// they are tagged with modifiers. /// they are tagged with modifiers.
semanticHighlighting_operator_enable: bool = true, semanticHighlighting_operator_enable: bool = true,
/// Use specialized semantic tokens for operators. /// Use specialized semantic tokens for operators.
/// ///
/// When enabled, rust-analyzer will emit special token types for operator tokens instead /// When enabled, rust-analyzer will emit special token types for operator tokens instead
/// of the generic `operator` token type. /// of the generic `operator` token type.
semanticHighlighting_operator_specialization_enable: bool = false, semanticHighlighting_operator_specialization_enable: bool = false,
/// Use semantic tokens for punctuation. /// Use semantic tokens for punctuation.
/// ///
/// When disabled, rust-analyzer will emit semantic tokens only for punctuation tokens when /// When disabled, rust-analyzer will emit semantic tokens only for punctuation tokens when
/// they are tagged with modifiers or have a special role. /// they are tagged with modifiers or have a special role.
semanticHighlighting_punctuation_enable: bool = false, semanticHighlighting_punctuation_enable: bool = false,
/// When enabled, rust-analyzer will emit a punctuation semantic token for the `!` of macro /// When enabled, rust-analyzer will emit a punctuation semantic token for the `!` of macro
/// calls. /// calls.
semanticHighlighting_punctuation_separate_macro_bang: bool = false, semanticHighlighting_punctuation_separate_macro_bang: bool = false,
/// Use specialized semantic tokens for punctuation. /// Use specialized semantic tokens for punctuation.
/// ///
/// When enabled, rust-analyzer will emit special token types for punctuation tokens instead /// When enabled, rust-analyzer will emit special token types for punctuation tokens instead
/// of the generic `punctuation` token type. /// of the generic `punctuation` token type.
semanticHighlighting_punctuation_specialization_enable: bool = false, semanticHighlighting_punctuation_specialization_enable: bool = false,
/// Use semantic tokens for strings. /// Use semantic tokens for strings.
/// ///
/// In some editors (e.g. vscode) semantic tokens override other highlighting grammars. /// In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
@ -334,15 +423,20 @@ config_data! {
/// Show full signature of the callable. Only shows parameters if disabled. /// Show full signature of the callable. Only shows parameters if disabled.
signatureInfo_detail: SignatureDetail = SignatureDetail::Full, signatureInfo_detail: SignatureDetail = SignatureDetail::Full,
/// Show documentation. /// Show documentation.
signatureInfo_documentation_enable: bool = true, signatureInfo_documentation_enable: bool = true,
/// Specify the characters allowed to invoke special on typing triggers. /// Specify the characters allowed to invoke special on typing triggers.
/// - typing `=` after `let` tries to smartly add `;` if `=` is followed by an existing expression ///
/// - typing `=` after `let` tries to smartly add `;` if `=` is followed by an existing
/// expression
/// - typing `=` between two expressions adds `;` when in statement position /// - typing `=` between two expressions adds `;` when in statement position
/// - typing `=` to turn an assignment into an equality comparison removes `;` when in expression position /// - typing `=` to turn an assignment into an equality comparison removes `;` when in
/// expression position
/// - typing `.` in a chain method call auto-indents /// - typing `.` in a chain method call auto-indents
/// - typing `{` or `(` in front of an expression inserts a closing `}` or `)` after the expression /// - typing `{` or `(` in front of an expression inserts a closing `}` or `)` after the
/// expression
/// - typing `{` in a use item adds a closing `}` in the right place /// - typing `{` in a use item adds a closing `}` in the right place
/// - typing `>` to complete a return type `->` will insert a whitespace after it /// - typing `>` to complete a return type `->` will insert a whitespace after it
/// - typing `<` in a path or type position inserts a closing `>` after the path or type. /// - typing `<` in a path or type position inserts a closing `>` after the path or type.
@ -374,8 +468,8 @@ config_data! {
/// ///
/// **Warning**: This format is provisional and subject to change. /// **Warning**: This format is provisional and subject to change.
/// ///
/// [`DiscoverWorkspaceConfig::command`] *must* return a JSON object /// [`DiscoverWorkspaceConfig::command`] *must* return a JSON object corresponding to
/// corresponding to `DiscoverProjectData::Finished`: /// `DiscoverProjectData::Finished`:
/// ///
/// ```norun /// ```norun
/// #[derive(Debug, Clone, Deserialize, Serialize)] /// #[derive(Debug, Clone, Deserialize, Serialize)]
@ -405,12 +499,11 @@ config_data! {
/// } /// }
/// ``` /// ```
/// ///
/// It is encouraged, but not required, to use the other variants on /// It is encouraged, but not required, to use the other variants on `DiscoverProjectData`
/// `DiscoverProjectData` to provide a more polished end-user experience. /// to provide a more polished end-user experience.
/// ///
/// `DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}`, /// `DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}`, which will be
/// which will be substituted with the JSON-serialized form of the following /// substituted with the JSON-serialized form of the following enum:
/// enum:
/// ///
/// ```norun /// ```norun
/// #[derive(PartialEq, Clone, Debug, Serialize)] /// #[derive(PartialEq, Clone, Debug, Serialize)]
@ -437,11 +530,10 @@ config_data! {
/// } /// }
/// ``` /// ```
/// ///
/// `DiscoverArgument::Path` is used to find and generate a `rust-project.json`, /// `DiscoverArgument::Path` is used to find and generate a `rust-project.json`, and
/// and therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to /// therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to to update an
/// to update an existing workspace. As a reference for implementors, /// existing workspace. As a reference for implementors, buck2's `rust-project` will likely
/// buck2's `rust-project` will likely be useful: /// be useful: https://github.com/facebook/buck2/tree/main/integrations/rust-project.
/// https://github.com/facebook/buck2/tree/main/integrations/rust-project.
workspace_discoverConfig: Option<DiscoverWorkspaceConfig> = None, workspace_discoverConfig: Option<DiscoverWorkspaceConfig> = None,
} }
} }
@ -449,109 +541,154 @@ config_data! {
config_data! { config_data! {
/// Local configurations can be defined per `SourceRoot`. This almost always corresponds to a `Crate`. /// Local configurations can be defined per `SourceRoot`. This almost always corresponds to a `Crate`.
local: struct LocalDefaultConfigData <- LocalConfigInput -> { local: struct LocalDefaultConfigData <- LocalConfigInput -> {
/// Whether to insert #[must_use] when generating `as_` methods /// Insert #[must_use] when generating `as_` methods for enum variants.
/// for enum variants.
assist_emitMustUse: bool = false, assist_emitMustUse: bool = false,
/// Placeholder expression to use for missing expressions in assists. /// Placeholder expression to use for missing expressions in assists.
assist_expressionFillDefault: ExprFillDefaultDef = ExprFillDefaultDef::Todo, assist_expressionFillDefault: ExprFillDefaultDef = ExprFillDefaultDef::Todo,
/// When inserting a type (e.g. in "fill match arms" assist), prefer to use `Self` over the type name where possible.
/// Prefer to use `Self` over the type name when inserting a type (e.g. in "fill match arms" assist).
assist_preferSelf: bool = false, assist_preferSelf: bool = false,
/// 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.
/// 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.
assist_termSearch_borrowcheck: bool = true, assist_termSearch_borrowcheck: bool = true,
/// Term search fuel in "units of work" for assists (Defaults to 1800). /// Term search fuel in "units of work" for assists (Defaults to 1800).
assist_termSearch_fuel: usize = 1800, assist_termSearch_fuel: usize = 1800,
/// Automatically add a semicolon when completing unit-returning functions.
/// Whether to automatically add a semicolon when completing unit-returning functions.
/// ///
/// In `match` arms it completes a comma instead. /// In `match` arms it completes a comma instead.
completion_addSemicolonToUnit: bool = true, completion_addSemicolonToUnit: bool = true,
/// Toggles the additional completions that automatically show method calls and field accesses with `await` prefixed to them when completing on a future.
/// Show method calls and field accesses completions with `await` prefixed to them when
/// completing on a future.
completion_autoAwait_enable: bool = true, completion_autoAwait_enable: bool = true,
/// Toggles the additional completions that automatically show method calls with `iter()` or `into_iter()` prefixed to them when completing on a type that has them.
/// Show method call completions with `iter()` or `into_iter()` prefixed to them when
/// completing on a type that has them.
completion_autoIter_enable: bool = true, completion_autoIter_enable: bool = 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. /// Show completions that automatically add imports when completed.
///
/// Note that your client must specify the `additionalTextEdits` LSP client capability to
/// truly have this feature enabled.
completion_autoimport_enable: bool = true, completion_autoimport_enable: bool = true,
/// A list of full paths to items to exclude from auto-importing completions. /// A list of full paths to items to exclude from auto-importing completions.
/// ///
/// Traits in this list won't have their methods suggested in completions unless the trait /// Traits in this list won't have their methods suggested in completions unless the trait
/// is in scope. /// is in scope.
/// ///
/// You can either specify a string path which defaults to type "always" or use the more verbose /// You can either specify a string path which defaults to type "always" or use the more
/// form `{ "path": "path::to::item", type: "always" }`. /// verbose form `{ "path": "path::to::item", type: "always" }`.
/// ///
/// For traits the type "methods" can be used to only exclude the methods but not the trait itself. /// For traits the type "methods" can be used to only exclude the methods but not the trait
/// itself.
/// ///
/// This setting also inherits `#rust-analyzer.completion.excludeTraits#`. /// This setting also inherits `#rust-analyzer.completion.excludeTraits#`.
completion_autoimport_exclude: Vec<AutoImportExclusion> = vec![ completion_autoimport_exclude: Vec<AutoImportExclusion> = vec![
AutoImportExclusion::Verbose { path: "core::borrow::Borrow".to_owned(), r#type: AutoImportExclusionType::Methods }, AutoImportExclusion::Verbose { path: "core::borrow::Borrow".to_owned(), r#type: AutoImportExclusionType::Methods },
AutoImportExclusion::Verbose { path: "core::borrow::BorrowMut".to_owned(), r#type: AutoImportExclusionType::Methods }, AutoImportExclusion::Verbose { path: "core::borrow::BorrowMut".to_owned(), r#type: AutoImportExclusionType::Methods },
], ],
/// Toggles the additional completions that automatically show method calls and field accesses
/// with `self` prefixed to them when inside a method. /// Show method calls and field access completions with `self` prefixed to them when
/// inside a method.
completion_autoself_enable: bool = true, completion_autoself_enable: bool = true,
/// Whether to add parenthesis and argument snippets when completing function.
/// Add parenthesis and argument snippets when completing function.
completion_callable_snippets: CallableCompletionDef = CallableCompletionDef::FillArguments, completion_callable_snippets: CallableCompletionDef = CallableCompletionDef::FillArguments,
/// A list of full paths to traits whose methods to exclude from completion. /// A list of full paths to traits whose methods to exclude from completion.
/// ///
/// Methods from these traits won't be completed, even if the trait is in scope. However, they will still be suggested on expressions whose type is `dyn Trait`, `impl Trait` or `T where T: Trait`. /// Methods from these traits won't be completed, even if the trait is in scope. However,
/// they will still be suggested on expressions whose type is `dyn Trait`, `impl Trait` or
/// `T where T: Trait`.
/// ///
/// Note that the trait themselves can still be completed. /// Note that the trait themselves can still be completed.
completion_excludeTraits: Vec<String> = Vec::new(), completion_excludeTraits: Vec<String> = Vec::new(),
/// Whether to show full function/method signatures in completion docs.
/// Show full function / method signatures in completion docs.
completion_fullFunctionSignatures_enable: bool = false, completion_fullFunctionSignatures_enable: bool = false,
/// Whether to omit deprecated items from autocompletion. By default they are marked as deprecated but not hidden.
/// Omit deprecated items from completions. By default they are marked as deprecated but not
/// hidden.
completion_hideDeprecated: bool = false, completion_hideDeprecated: bool = false,
/// Maximum number of completions to return. If `None`, the limit is infinite. /// Maximum number of completions to return. If `None`, the limit is infinite.
completion_limit: Option<usize> = None, completion_limit: Option<usize> = None,
/// Whether to show postfix snippets like `dbg`, `if`, `not`, etc.
/// Show postfix snippets like `dbg`, `if`, `not`, etc.
completion_postfix_enable: bool = true, completion_postfix_enable: bool = true,
/// Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position.
/// Show completions of private items and fields that are defined in the current workspace
/// even if they are not visible at the current position.
completion_privateEditable_enable: bool = false, completion_privateEditable_enable: bool = false,
/// Whether to enable term search based snippets like `Some(foo.bar().baz())`.
/// Enable term search based snippets like `Some(foo.bar().baz())`.
completion_termSearch_enable: bool = false, completion_termSearch_enable: bool = false,
/// Term search fuel in "units of work" for autocompletion (Defaults to 1000). /// Term search fuel in "units of work" for autocompletion (Defaults to 1000).
completion_termSearch_fuel: usize = 1000, completion_termSearch_fuel: usize = 1000,
/// List of rust-analyzer diagnostics to disable. /// List of rust-analyzer diagnostics to disable.
diagnostics_disabled: FxHashSet<String> = FxHashSet::default(), diagnostics_disabled: FxHashSet<String> = FxHashSet::default(),
/// Whether to show native rust-analyzer diagnostics.
/// Show native rust-analyzer diagnostics.
diagnostics_enable: bool = true, diagnostics_enable: bool = true,
/// Whether to show experimental rust-analyzer diagnostics that might
/// have more false positives than usual. /// Show experimental rust-analyzer diagnostics that might have more false positives than
/// usual.
diagnostics_experimental_enable: bool = false, diagnostics_experimental_enable: bool = false,
/// Map of prefixes to be substituted when parsing diagnostic file paths.
/// This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`. /// Map of prefixes to be substituted when parsing diagnostic file paths. This should be the
/// reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
diagnostics_remapPrefix: FxHashMap<String, String> = FxHashMap::default(), diagnostics_remapPrefix: FxHashMap<String, String> = FxHashMap::default(),
/// Whether to run additional style lints.
/// Run additional style lints.
diagnostics_styleLints_enable: bool = false, diagnostics_styleLints_enable: bool = false,
/// List of warnings that should be displayed with hint severity. /// List of warnings that should be displayed with hint severity.
/// ///
/// The warnings will be indicated by faded text or three dots in code /// The warnings will be indicated by faded text or three dots in code and will not show up
/// and will not show up in the `Problems Panel`. /// in the `Problems Panel`.
diagnostics_warningsAsHint: Vec<String> = vec![], diagnostics_warningsAsHint: Vec<String> = vec![],
/// List of warnings that should be displayed with info severity. /// List of warnings that should be displayed with info severity.
/// ///
/// The warnings will be indicated by a blue squiggly underline in code /// The warnings will be indicated by a blue squiggly underline in code and a blue icon in
/// and a blue icon in the `Problems Panel`. /// the `Problems Panel`.
diagnostics_warningsAsInfo: Vec<String> = vec![], diagnostics_warningsAsInfo: Vec<String> = vec![],
/// 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. /// Enforce the import granularity setting for all files. If set to false rust-analyzer will
/// try to keep import styles consistent per file.
imports_granularity_enforce: bool = false, imports_granularity_enforce: bool = false,
/// How imports should be grouped into use statements. /// How imports should be grouped into use statements.
imports_granularity_group: ImportGranularityDef = ImportGranularityDef::Crate, imports_granularity_group: ImportGranularityDef = ImportGranularityDef::Crate,
/// Group inserted imports by the [following order](https://rust-analyzer.github.io/book/features.html#auto-import). Groups are separated by newlines.
/// Group inserted imports by the [following
/// order](https://rust-analyzer.github.io/book/features.html#auto-import). Groups are
/// separated by newlines.
imports_group_enable: bool = true, imports_group_enable: bool = true,
/// Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
/// Allow import insertion to merge new imports into single path glob imports like `use
/// std::fmt::*;`.
imports_merge_glob: bool = true, imports_merge_glob: bool = true,
/// Prefer to unconditionally use imports of the core and alloc crate, over the std crate. /// Prefer to unconditionally use imports of the core and alloc crate, over the std crate.
imports_preferNoStd | imports_prefer_no_std: bool = false, imports_preferNoStd | imports_prefer_no_std: bool = false,
/// Whether to prefer import paths containing a `prelude` module.
/// Prefer import paths containing a `prelude` module.
imports_preferPrelude: bool = false, imports_preferPrelude: bool = false,
/// The path structure for newly inserted paths to use. /// The path structure for newly inserted paths to use.
imports_prefix: ImportPrefixDef = ImportPrefixDef::ByCrate, imports_prefix: ImportPrefixDef = ImportPrefixDef::ByCrate,
/// Whether to prefix external (including std, core) crate imports with `::`. e.g. "use ::std::io::Read;".
/// Prefix external (including std, core) crate imports with `::`.
///
/// E.g. `use ::std::io::Read;`.
imports_prefixExternPrelude: bool = false, imports_prefixExternPrelude: bool = false,
} }
} }
@ -3201,8 +3338,10 @@ fn schema(fields: &[SchemaField]) -> serde_json::Value {
.iter() .iter()
.map(|(field, ty, doc, default)| { .map(|(field, ty, doc, default)| {
let name = field.replace('_', "."); let name = field.replace('_', ".");
let category = let category = name
name.find('.').map(|end| String::from(&name[..end])).unwrap_or("general".into()); .split_once(".")
.map(|(category, _name)| to_title_case(category))
.unwrap_or("rust-analyzer".into());
let name = format!("rust-analyzer.{name}"); let name = format!("rust-analyzer.{name}");
let props = field_props(field, ty, doc, default); let props = field_props(field, ty, doc, default);
serde_json::json!({ serde_json::json!({
@ -3216,6 +3355,29 @@ fn schema(fields: &[SchemaField]) -> serde_json::Value {
map.into() map.into()
} }
/// Translate a field name to a title case string suitable for use in the category names on the
/// vscode settings page.
///
/// First letter of word should be uppercase, if an uppercase letter is encountered, add a space
/// before it e.g. "fooBar" -> "Foo Bar", "fooBarBaz" -> "Foo Bar Baz", "foo" -> "Foo"
///
/// This likely should be in stdx (or just use heck instead), but it doesn't handle any edge cases
/// and is intentionally simple.
fn to_title_case(s: &str) -> String {
let mut result = String::with_capacity(s.len());
let mut chars = s.chars();
if let Some(first) = chars.next() {
result.push(first.to_ascii_uppercase());
for c in chars {
if c.is_uppercase() {
result.push(' ');
}
result.push(c);
}
}
result
}
fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json::Value { fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json::Value {
let doc = doc_comment_to_string(doc); let doc = doc_comment_to_string(doc);
let doc = doc.trim_end_matches('\n'); let doc = doc.trim_end_matches('\n');

View file

@ -2,8 +2,7 @@
Default: `false` Default: `false`
Whether to insert #[must_use] when generating `as_` methods Insert #[must_use] when generating `as_` methods for enum variants.
for enum variants.
## rust-analyzer.assist.expressionFillDefault {#assist.expressionFillDefault} ## rust-analyzer.assist.expressionFillDefault {#assist.expressionFillDefault}
@ -17,14 +16,15 @@ Placeholder expression to use for missing expressions in assists.
Default: `false` Default: `false`
When inserting a type (e.g. in "fill match arms" assist), prefer to use `Self` over the type name where possible. Prefer to use `Self` over the type name when inserting a type (e.g. in "fill match arms" assist).
## rust-analyzer.assist.termSearch.borrowcheck {#assist.termSearch.borrowcheck} ## rust-analyzer.assist.termSearch.borrowcheck {#assist.termSearch.borrowcheck}
Default: `true` Default: `true`
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. 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.
## rust-analyzer.assist.termSearch.fuel {#assist.termSearch.fuel} ## rust-analyzer.assist.termSearch.fuel {#assist.termSearch.fuel}
@ -45,7 +45,8 @@ Warm up caches on project load.
Default: `"physical"` Default: `"physical"`
How many worker threads to handle priming caches. The default `0` means to pick automatically. How many worker threads to handle priming caches. The default `0` means to pick
automatically.
## rust-analyzer.cargo.allTargets {#cargo.allTargets} ## rust-analyzer.cargo.allTargets {#cargo.allTargets}
@ -358,7 +359,7 @@ check will be performed.
Default: `true` Default: `true`
Whether to automatically add a semicolon when completing unit-returning functions. Automatically add a semicolon when completing unit-returning functions.
In `match` arms it completes a comma instead. In `match` arms it completes a comma instead.
@ -367,22 +368,26 @@ In `match` arms it completes a comma instead.
Default: `true` Default: `true`
Toggles the additional completions that automatically show method calls and field accesses with `await` prefixed to them when completing on a future. Show method calls and field accesses completions with `await` prefixed to them when
completing on a future.
## rust-analyzer.completion.autoIter.enable {#completion.autoIter.enable} ## rust-analyzer.completion.autoIter.enable {#completion.autoIter.enable}
Default: `true` Default: `true`
Toggles the additional completions that automatically show method calls with `iter()` or `into_iter()` prefixed to them when completing on a type that has them. Show method call completions with `iter()` or `into_iter()` prefixed to them when
completing on a type that has them.
## rust-analyzer.completion.autoimport.enable {#completion.autoimport.enable} ## rust-analyzer.completion.autoimport.enable {#completion.autoimport.enable}
Default: `true` Default: `true`
Toggles the additional completions that automatically add imports when completed. Show completions that automatically add imports when completed.
Note that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.
Note that your client must specify the `additionalTextEdits` LSP client capability to
truly have this feature enabled.
## rust-analyzer.completion.autoimport.exclude {#completion.autoimport.exclude} ## rust-analyzer.completion.autoimport.exclude {#completion.autoimport.exclude}
@ -406,10 +411,11 @@ A list of full paths to items to exclude from auto-importing completions.
Traits in this list won't have their methods suggested in completions unless the trait Traits in this list won't have their methods suggested in completions unless the trait
is in scope. is in scope.
You can either specify a string path which defaults to type "always" or use the more verbose You can either specify a string path which defaults to type "always" or use the more
form `{ "path": "path::to::item", type: "always" }`. verbose form `{ "path": "path::to::item", type: "always" }`.
For traits the type "methods" can be used to only exclude the methods but not the trait itself. For traits the type "methods" can be used to only exclude the methods but not the trait
itself.
This setting also inherits `#rust-analyzer.completion.excludeTraits#`. This setting also inherits `#rust-analyzer.completion.excludeTraits#`.
@ -418,15 +424,15 @@ This setting also inherits `#rust-analyzer.completion.excludeTraits#`.
Default: `true` Default: `true`
Toggles the additional completions that automatically show method calls and field accesses Show method calls and field access completions with `self` prefixed to them when
with `self` prefixed to them when inside a method. inside a method.
## rust-analyzer.completion.callable.snippets {#completion.callable.snippets} ## rust-analyzer.completion.callable.snippets {#completion.callable.snippets}
Default: `"fill_arguments"` Default: `"fill_arguments"`
Whether to add parenthesis and argument snippets when completing function. Add parenthesis and argument snippets when completing function.
## rust-analyzer.completion.excludeTraits {#completion.excludeTraits} ## rust-analyzer.completion.excludeTraits {#completion.excludeTraits}
@ -435,7 +441,9 @@ Default: `[]`
A list of full paths to traits whose methods to exclude from completion. A list of full paths to traits whose methods to exclude from completion.
Methods from these traits won't be completed, even if the trait is in scope. However, they will still be suggested on expressions whose type is `dyn Trait`, `impl Trait` or `T where T: Trait`. Methods from these traits won't be completed, even if the trait is in scope. However,
they will still be suggested on expressions whose type is `dyn Trait`, `impl Trait` or
`T where T: Trait`.
Note that the trait themselves can still be completed. Note that the trait themselves can still be completed.
@ -444,14 +452,15 @@ Note that the trait themselves can still be completed.
Default: `false` Default: `false`
Whether to show full function/method signatures in completion docs. Show full function / method signatures in completion docs.
## rust-analyzer.completion.hideDeprecated {#completion.hideDeprecated} ## rust-analyzer.completion.hideDeprecated {#completion.hideDeprecated}
Default: `false` Default: `false`
Whether to omit deprecated items from autocompletion. By default they are marked as deprecated but not hidden. Omit deprecated items from completions. By default they are marked as deprecated but not
hidden.
## rust-analyzer.completion.limit {#completion.limit} ## rust-analyzer.completion.limit {#completion.limit}
@ -465,14 +474,15 @@ Maximum number of completions to return. If `None`, the limit is infinite.
Default: `true` Default: `true`
Whether to show postfix snippets like `dbg`, `if`, `not`, etc. Show postfix snippets like `dbg`, `if`, `not`, etc.
## rust-analyzer.completion.privateEditable.enable {#completion.privateEditable.enable} ## rust-analyzer.completion.privateEditable.enable {#completion.privateEditable.enable}
Default: `false` Default: `false`
Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position. Show completions of private items and fields that are defined in the current workspace
even if they are not visible at the current position.
## rust-analyzer.completion.snippets.custom {#completion.snippets.custom} ## rust-analyzer.completion.snippets.custom {#completion.snippets.custom}
@ -529,7 +539,7 @@ Custom completion snippets.
Default: `false` Default: `false`
Whether to enable term search based snippets like `Some(foo.bar().baz())`. Enable term search based snippets like `Some(foo.bar().baz())`.
## rust-analyzer.completion.termSearch.fuel {#completion.termSearch.fuel} ## rust-analyzer.completion.termSearch.fuel {#completion.termSearch.fuel}
@ -550,30 +560,30 @@ List of rust-analyzer diagnostics to disable.
Default: `true` Default: `true`
Whether to show native rust-analyzer diagnostics. Show native rust-analyzer diagnostics.
## rust-analyzer.diagnostics.experimental.enable {#diagnostics.experimental.enable} ## rust-analyzer.diagnostics.experimental.enable {#diagnostics.experimental.enable}
Default: `false` Default: `false`
Whether to show experimental rust-analyzer diagnostics that might Show experimental rust-analyzer diagnostics that might have more false positives than
have more false positives than usual. usual.
## rust-analyzer.diagnostics.remapPrefix {#diagnostics.remapPrefix} ## rust-analyzer.diagnostics.remapPrefix {#diagnostics.remapPrefix}
Default: `{}` Default: `{}`
Map of prefixes to be substituted when parsing diagnostic file paths. Map of prefixes to be substituted when parsing diagnostic file paths. This should be the
This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`. reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
## rust-analyzer.diagnostics.styleLints.enable {#diagnostics.styleLints.enable} ## rust-analyzer.diagnostics.styleLints.enable {#diagnostics.styleLints.enable}
Default: `false` Default: `false`
Whether to run additional style lints. Run additional style lints.
## rust-analyzer.diagnostics.warningsAsHint {#diagnostics.warningsAsHint} ## rust-analyzer.diagnostics.warningsAsHint {#diagnostics.warningsAsHint}
@ -582,8 +592,8 @@ Default: `[]`
List of warnings that should be displayed with hint severity. List of warnings that should be displayed with hint severity.
The warnings will be indicated by faded text or three dots in code The warnings will be indicated by faded text or three dots in code and will not show up
and will not show up in the `Problems Panel`. in the `Problems Panel`.
## rust-analyzer.diagnostics.warningsAsInfo {#diagnostics.warningsAsInfo} ## rust-analyzer.diagnostics.warningsAsInfo {#diagnostics.warningsAsInfo}
@ -592,17 +602,19 @@ Default: `[]`
List of warnings that should be displayed with info severity. List of warnings that should be displayed with info severity.
The warnings will be indicated by a blue squiggly underline in code The warnings will be indicated by a blue squiggly underline in code and a blue icon in
and a blue icon in the `Problems Panel`. the `Problems Panel`.
## rust-analyzer.files.exclude {#files.exclude} ## rust-analyzer.files.exclude {#files.exclude}
Default: `[]` Default: `[]`
These paths (file/directories) will be ignored by rust-analyzer. They are List of files to ignore
relative to the workspace root, and globs are not supported. You may
also need to add the folders to Code's `files.watcherExclude`. These paths (file/directories) will be ignored by rust-analyzer. They are relative to
the workspace root, and globs are not supported. You may also need to add the folders to
Code's `files.watcherExclude`.
## rust-analyzer.files.watcher {#files.watcher} ## rust-analyzer.files.watcher {#files.watcher}
@ -616,64 +628,67 @@ Controls file watching implementation.
Default: `true` Default: `true`
Enables highlighting of related return values while the cursor is on any `match`, `if`, or match arm arrow (`=>`). Highlight related return values while the cursor is on any `match`, `if`, or match arm
arrow (`=>`).
## rust-analyzer.highlightRelated.breakPoints.enable {#highlightRelated.breakPoints.enable} ## rust-analyzer.highlightRelated.breakPoints.enable {#highlightRelated.breakPoints.enable}
Default: `true` Default: `true`
Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords. Highlight related references while the cursor is on `break`, `loop`, `while`, or `for`
keywords.
## rust-analyzer.highlightRelated.closureCaptures.enable {#highlightRelated.closureCaptures.enable} ## rust-analyzer.highlightRelated.closureCaptures.enable {#highlightRelated.closureCaptures.enable}
Default: `true` Default: `true`
Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure. Highlight all captures of a closure while the cursor is on the `|` or move keyword of a closure.
## rust-analyzer.highlightRelated.exitPoints.enable {#highlightRelated.exitPoints.enable} ## rust-analyzer.highlightRelated.exitPoints.enable {#highlightRelated.exitPoints.enable}
Default: `true` Default: `true`
Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`). Highlight all exit points while the cursor is on any `return`, `?`, `fn`, or return type
arrow (`->`).
## rust-analyzer.highlightRelated.references.enable {#highlightRelated.references.enable} ## rust-analyzer.highlightRelated.references.enable {#highlightRelated.references.enable}
Default: `true` Default: `true`
Enables highlighting of related references while the cursor is on any identifier. Highlight related references while the cursor is on any identifier.
## rust-analyzer.highlightRelated.yieldPoints.enable {#highlightRelated.yieldPoints.enable} ## rust-analyzer.highlightRelated.yieldPoints.enable {#highlightRelated.yieldPoints.enable}
Default: `true` Default: `true`
Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords. Highlight all break points for a loop or block context while the cursor is on any
`async` or `await` keywords.
## rust-analyzer.hover.actions.debug.enable {#hover.actions.debug.enable} ## rust-analyzer.hover.actions.debug.enable {#hover.actions.debug.enable}
Default: `true` Default: `true`
Whether to show `Debug` action. Only applies when Show `Debug` action. Only applies when `#rust-analyzer.hover.actions.enable#` is set.
`#rust-analyzer.hover.actions.enable#` is set.
## rust-analyzer.hover.actions.enable {#hover.actions.enable} ## rust-analyzer.hover.actions.enable {#hover.actions.enable}
Default: `true` Default: `true`
Whether to show HoverActions in Rust files. Show HoverActions in Rust files.
## rust-analyzer.hover.actions.gotoTypeDef.enable {#hover.actions.gotoTypeDef.enable} ## rust-analyzer.hover.actions.gotoTypeDef.enable {#hover.actions.gotoTypeDef.enable}
Default: `true` Default: `true`
Whether to show `Go to Type Definition` action. Only applies when Show `Go to Type Definition` action. Only applies when
`#rust-analyzer.hover.actions.enable#` is set. `#rust-analyzer.hover.actions.enable#` is set.
@ -681,46 +696,45 @@ Whether to show `Go to Type Definition` action. Only applies when
Default: `true` Default: `true`
Whether to show `Implementations` action. Only applies when Show `Implementations` action. Only applies when `#rust-analyzer.hover.actions.enable#`
`#rust-analyzer.hover.actions.enable#` is set. is set.
## rust-analyzer.hover.actions.references.enable {#hover.actions.references.enable} ## rust-analyzer.hover.actions.references.enable {#hover.actions.references.enable}
Default: `false` Default: `false`
Whether to show `References` action. Only applies when Show `References` action. Only applies when `#rust-analyzer.hover.actions.enable#` is
`#rust-analyzer.hover.actions.enable#` is set. set.
## rust-analyzer.hover.actions.run.enable {#hover.actions.run.enable} ## rust-analyzer.hover.actions.run.enable {#hover.actions.run.enable}
Default: `true` Default: `true`
Whether to show `Run` action. Only applies when Show `Run` action. Only applies when `#rust-analyzer.hover.actions.enable#` is set.
`#rust-analyzer.hover.actions.enable#` is set.
## rust-analyzer.hover.actions.updateTest.enable {#hover.actions.updateTest.enable} ## rust-analyzer.hover.actions.updateTest.enable {#hover.actions.updateTest.enable}
Default: `true` Default: `true`
Whether to show `Update Test` action. Only applies when Show `Update Test` action. Only applies when `#rust-analyzer.hover.actions.enable#` and
`#rust-analyzer.hover.actions.enable#` and `#rust-analyzer.hover.actions.run.enable#` are set. `#rust-analyzer.hover.actions.run.enable#` are set.
## rust-analyzer.hover.documentation.enable {#hover.documentation.enable} ## rust-analyzer.hover.documentation.enable {#hover.documentation.enable}
Default: `true` Default: `true`
Whether to show documentation on hover. Show documentation on hover.
## rust-analyzer.hover.documentation.keywords.enable {#hover.documentation.keywords.enable} ## rust-analyzer.hover.documentation.keywords.enable {#hover.documentation.keywords.enable}
Default: `true` Default: `true`
Whether to show keyword hover popups. Only applies when Show keyword hover popups. Only applies when
`#rust-analyzer.hover.documentation.enable#` is set. `#rust-analyzer.hover.documentation.enable#` is set.
@ -728,7 +742,7 @@ Whether to show keyword hover popups. Only applies when
Default: `true` Default: `true`
Whether to show drop glue information on hover. Show drop glue information on hover.
## rust-analyzer.hover.links.enable {#hover.links.enable} ## rust-analyzer.hover.links.enable {#hover.links.enable}
@ -742,9 +756,11 @@ Use markdown syntax for links on hover.
Default: `20` Default: `20`
Whether to show what types are used as generic arguments in calls etc. on hover, and what is their max length to show such types, beyond it they will be shown with ellipsis. Show what types are used as generic arguments in calls etc. on hover, and limit the max
length to show such types, beyond which they will be shown with ellipsis.
This can take three values: `null` means "unlimited", the string `"hide"` means to not show generic substitutions at all, and a number means to limit them to X characters. This can take three values: `null` means "unlimited", the string `"hide"` means to not
show generic substitutions at all, and a number means to limit them to X characters.
The default is 20 characters. The default is 20 characters.
@ -760,7 +776,7 @@ How to render the align information in a memory layout hover.
Default: `true` Default: `true`
Whether to show memory layout data on hover. Show memory layout data on hover.
## rust-analyzer.hover.memoryLayout.niches {#hover.memoryLayout.niches} ## rust-analyzer.hover.memoryLayout.niches {#hover.memoryLayout.niches}
@ -802,7 +818,8 @@ How many variants of an enum to display when hovering on. Show none if empty.
Default: `5` Default: `5`
How many fields of a struct, variant or union to display when hovering on. Show none if empty. How many fields of a struct, variant or union to display when hovering on. Show none if
empty.
## rust-analyzer.hover.show.traitAssocItems {#hover.show.traitAssocItems} ## rust-analyzer.hover.show.traitAssocItems {#hover.show.traitAssocItems}
@ -816,7 +833,8 @@ How many associated items of a trait to display when hovering a trait.
Default: `false` Default: `false`
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. Enforce the import granularity setting for all files. If set to false rust-analyzer will
try to keep import styles consistent per file.
## rust-analyzer.imports.granularity.group {#imports.granularity.group} ## rust-analyzer.imports.granularity.group {#imports.granularity.group}
@ -830,14 +848,17 @@ How imports should be grouped into use statements.
Default: `true` Default: `true`
Group inserted imports by the [following order](https://rust-analyzer.github.io/book/features.html#auto-import). Groups are separated by newlines. Group inserted imports by the [following
order](https://rust-analyzer.github.io/book/features.html#auto-import). Groups are
separated by newlines.
## rust-analyzer.imports.merge.glob {#imports.merge.glob} ## rust-analyzer.imports.merge.glob {#imports.merge.glob}
Default: `true` Default: `true`
Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. Allow import insertion to merge new imports into single path glob imports like `use
std::fmt::*;`.
## rust-analyzer.imports.preferNoStd {#imports.preferNoStd} ## rust-analyzer.imports.preferNoStd {#imports.preferNoStd}
@ -851,7 +872,7 @@ Prefer to unconditionally use imports of the core and alloc crate, over the std
Default: `false` Default: `false`
Whether to prefer import paths containing a `prelude` module. Prefer import paths containing a `prelude` module.
## rust-analyzer.imports.prefix {#imports.prefix} ## rust-analyzer.imports.prefix {#imports.prefix}
@ -865,28 +886,30 @@ The path structure for newly inserted paths to use.
Default: `false` Default: `false`
Whether to prefix external (including std, core) crate imports with `::`. e.g. "use ::std::io::Read;". Prefix external (including std, core) crate imports with `::`.
E.g. `use ::std::io::Read;`.
## rust-analyzer.inlayHints.bindingModeHints.enable {#inlayHints.bindingModeHints.enable} ## rust-analyzer.inlayHints.bindingModeHints.enable {#inlayHints.bindingModeHints.enable}
Default: `false` Default: `false`
Whether to show inlay type hints for binding modes. Show inlay type hints for binding modes.
## rust-analyzer.inlayHints.chainingHints.enable {#inlayHints.chainingHints.enable} ## rust-analyzer.inlayHints.chainingHints.enable {#inlayHints.chainingHints.enable}
Default: `true` Default: `true`
Whether to show inlay type hints for method chains. Show inlay type hints for method chains.
## rust-analyzer.inlayHints.closingBraceHints.enable {#inlayHints.closingBraceHints.enable} ## rust-analyzer.inlayHints.closingBraceHints.enable {#inlayHints.closingBraceHints.enable}
Default: `true` Default: `true`
Whether to show inlay hints after a closing `}` to indicate what item it belongs to. Show inlay hints after a closing `}` to indicate what item it belongs to.
## rust-analyzer.inlayHints.closingBraceHints.minLines {#inlayHints.closingBraceHints.minLines} ## rust-analyzer.inlayHints.closingBraceHints.minLines {#inlayHints.closingBraceHints.minLines}
@ -901,14 +924,14 @@ to always show them).
Default: `false` Default: `false`
Whether to show inlay hints for closure captures. Show inlay hints for closure captures.
## rust-analyzer.inlayHints.closureReturnTypeHints.enable {#inlayHints.closureReturnTypeHints.enable} ## rust-analyzer.inlayHints.closureReturnTypeHints.enable {#inlayHints.closureReturnTypeHints.enable}
Default: `"never"` Default: `"never"`
Whether to show inlay type hints for return types of closures. Show inlay type hints for return types of closures.
## rust-analyzer.inlayHints.closureStyle {#inlayHints.closureStyle} ## rust-analyzer.inlayHints.closureStyle {#inlayHints.closureStyle}
@ -922,77 +945,77 @@ Closure notation in type and chaining inlay hints.
Default: `"never"` Default: `"never"`
Whether to show enum variant discriminant hints. Show enum variant discriminant hints.
## rust-analyzer.inlayHints.expressionAdjustmentHints.enable {#inlayHints.expressionAdjustmentHints.enable} ## rust-analyzer.inlayHints.expressionAdjustmentHints.enable {#inlayHints.expressionAdjustmentHints.enable}
Default: `"never"` Default: `"never"`
Whether to show inlay hints for type adjustments. Show inlay hints for type adjustments.
## rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe {#inlayHints.expressionAdjustmentHints.hideOutsideUnsafe} ## rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe {#inlayHints.expressionAdjustmentHints.hideOutsideUnsafe}
Default: `false` Default: `false`
Whether to hide inlay hints for type adjustments outside of `unsafe` blocks. Hide inlay hints for type adjustments outside of `unsafe` blocks.
## rust-analyzer.inlayHints.expressionAdjustmentHints.mode {#inlayHints.expressionAdjustmentHints.mode} ## rust-analyzer.inlayHints.expressionAdjustmentHints.mode {#inlayHints.expressionAdjustmentHints.mode}
Default: `"prefix"` Default: `"prefix"`
Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc). Show inlay hints as postfix ops (`.*` instead of `*`, etc).
## rust-analyzer.inlayHints.genericParameterHints.const.enable {#inlayHints.genericParameterHints.const.enable} ## rust-analyzer.inlayHints.genericParameterHints.const.enable {#inlayHints.genericParameterHints.const.enable}
Default: `true` Default: `true`
Whether to show const generic parameter name inlay hints. Show const generic parameter name inlay hints.
## rust-analyzer.inlayHints.genericParameterHints.lifetime.enable {#inlayHints.genericParameterHints.lifetime.enable} ## rust-analyzer.inlayHints.genericParameterHints.lifetime.enable {#inlayHints.genericParameterHints.lifetime.enable}
Default: `false` Default: `false`
Whether to show generic lifetime parameter name inlay hints. Show generic lifetime parameter name inlay hints.
## rust-analyzer.inlayHints.genericParameterHints.type.enable {#inlayHints.genericParameterHints.type.enable} ## rust-analyzer.inlayHints.genericParameterHints.type.enable {#inlayHints.genericParameterHints.type.enable}
Default: `false` Default: `false`
Whether to show generic type parameter name inlay hints. Show generic type parameter name inlay hints.
## rust-analyzer.inlayHints.implicitDrops.enable {#inlayHints.implicitDrops.enable} ## rust-analyzer.inlayHints.implicitDrops.enable {#inlayHints.implicitDrops.enable}
Default: `false` Default: `false`
Whether to show implicit drop hints. Show implicit drop hints.
## rust-analyzer.inlayHints.implicitSizedBoundHints.enable {#inlayHints.implicitSizedBoundHints.enable} ## rust-analyzer.inlayHints.implicitSizedBoundHints.enable {#inlayHints.implicitSizedBoundHints.enable}
Default: `false` Default: `false`
Whether to show inlay hints for the implied type parameter `Sized` bound. Show inlay hints for the implied type parameter `Sized` bound.
## rust-analyzer.inlayHints.lifetimeElisionHints.enable {#inlayHints.lifetimeElisionHints.enable} ## rust-analyzer.inlayHints.lifetimeElisionHints.enable {#inlayHints.lifetimeElisionHints.enable}
Default: `"never"` Default: `"never"`
Whether to show inlay type hints for elided lifetimes in function signatures. Show inlay type hints for elided lifetimes in function signatures.
## rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames {#inlayHints.lifetimeElisionHints.useParameterNames} ## rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames {#inlayHints.lifetimeElisionHints.useParameterNames}
Default: `false` Default: `false`
Whether to prefer using parameter names as the name for elided lifetime hints if possible. Prefer using parameter names as the name for elided lifetime hints if possible.
## rust-analyzer.inlayHints.maxLength {#inlayHints.maxLength} ## rust-analyzer.inlayHints.maxLength {#inlayHints.maxLength}
@ -1006,23 +1029,24 @@ Maximum length for inlay hints. Set to null to have an unlimited length.
Default: `true` Default: `true`
Whether to show function parameter name inlay hints at the call Show function parameter name inlay hints at the call site.
site.
## rust-analyzer.inlayHints.rangeExclusiveHints.enable {#inlayHints.rangeExclusiveHints.enable} ## rust-analyzer.inlayHints.rangeExclusiveHints.enable {#inlayHints.rangeExclusiveHints.enable}
Default: `false` Default: `false`
Whether to show exclusive range inlay hints. Show exclusive range inlay hints.
## rust-analyzer.inlayHints.reborrowHints.enable {#inlayHints.reborrowHints.enable} ## rust-analyzer.inlayHints.reborrowHints.enable {#inlayHints.reborrowHints.enable}
Default: `"never"` Default: `"never"`
Whether to show inlay hints for compiler inserted reborrows. Show inlay hints for compiler inserted reborrows.
This setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.
This setting is deprecated in favor of
#rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.
## rust-analyzer.inlayHints.renderColons {#inlayHints.renderColons} ## rust-analyzer.inlayHints.renderColons {#inlayHints.renderColons}
@ -1036,36 +1060,38 @@ Whether to render leading colons for type hints, and trailing colons for paramet
Default: `true` Default: `true`
Whether to show inlay type hints for variables. Show inlay type hints for variables.
## rust-analyzer.inlayHints.typeHints.hideClosureInitialization {#inlayHints.typeHints.hideClosureInitialization} ## rust-analyzer.inlayHints.typeHints.hideClosureInitialization {#inlayHints.typeHints.hideClosureInitialization}
Default: `false` Default: `false`
Whether to hide inlay type hints for `let` statements that initialize to a closure. Hide inlay type hints for `let` statements that initialize to a closure.
Only applies to closures with blocks, same as `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`.
Only applies to closures with blocks, same as
`#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`.
## rust-analyzer.inlayHints.typeHints.hideClosureParameter {#inlayHints.typeHints.hideClosureParameter} ## rust-analyzer.inlayHints.typeHints.hideClosureParameter {#inlayHints.typeHints.hideClosureParameter}
Default: `false` Default: `false`
Whether to hide inlay parameter type hints for closures. Hide inlay parameter type hints for closures.
## rust-analyzer.inlayHints.typeHints.hideNamedConstructor {#inlayHints.typeHints.hideNamedConstructor} ## rust-analyzer.inlayHints.typeHints.hideNamedConstructor {#inlayHints.typeHints.hideNamedConstructor}
Default: `false` Default: `false`
Whether to hide inlay type hints for constructors. Hide inlay type hints for constructors.
## rust-analyzer.interpret.tests {#interpret.tests} ## rust-analyzer.interpret.tests {#interpret.tests}
Default: `false` Default: `false`
Enables the experimental support for interpreting tests. Enable the experimental support for interpreting tests.
## rust-analyzer.joinLines.joinAssignments {#joinLines.joinAssignments} ## rust-analyzer.joinLines.joinAssignments {#joinLines.joinAssignments}
@ -1100,23 +1126,21 @@ Join lines unwraps trivial blocks.
Default: `true` Default: `true`
Whether to show `Debug` lens. Only applies when Show `Debug` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
`#rust-analyzer.lens.enable#` is set.
## rust-analyzer.lens.enable {#lens.enable} ## rust-analyzer.lens.enable {#lens.enable}
Default: `true` Default: `true`
Whether to show CodeLens in Rust files. Show CodeLens in Rust files.
## rust-analyzer.lens.implementations.enable {#lens.implementations.enable} ## rust-analyzer.lens.implementations.enable {#lens.implementations.enable}
Default: `true` Default: `true`
Whether to show `Implementations` lens. Only applies when Show `Implementations` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
`#rust-analyzer.lens.enable#` is set.
## rust-analyzer.lens.location {#lens.location} ## rust-analyzer.lens.location {#lens.location}
@ -1130,60 +1154,56 @@ Where to render annotations.
Default: `false` Default: `false`
Whether to show `References` lens for Struct, Enum, and Union. Show `References` lens for Struct, Enum, and Union. Only applies when
Only applies when `#rust-analyzer.lens.enable#` is set. `#rust-analyzer.lens.enable#` is set.
## rust-analyzer.lens.references.enumVariant.enable {#lens.references.enumVariant.enable} ## rust-analyzer.lens.references.enumVariant.enable {#lens.references.enumVariant.enable}
Default: `false` Default: `false`
Whether to show `References` lens for Enum Variants. Show `References` lens for Enum Variants. Only applies when
Only applies when `#rust-analyzer.lens.enable#` is set. `#rust-analyzer.lens.enable#` is set.
## rust-analyzer.lens.references.method.enable {#lens.references.method.enable} ## rust-analyzer.lens.references.method.enable {#lens.references.method.enable}
Default: `false` Default: `false`
Whether to show `Method References` lens. Only applies when Show `Method References` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
`#rust-analyzer.lens.enable#` is set.
## rust-analyzer.lens.references.trait.enable {#lens.references.trait.enable} ## rust-analyzer.lens.references.trait.enable {#lens.references.trait.enable}
Default: `false` Default: `false`
Whether to show `References` lens for Trait. Show `References` lens for Trait. Only applies when `#rust-analyzer.lens.enable#` is
Only applies when `#rust-analyzer.lens.enable#` is set. set.
## rust-analyzer.lens.run.enable {#lens.run.enable} ## rust-analyzer.lens.run.enable {#lens.run.enable}
Default: `true` Default: `true`
Whether to show `Run` lens. Only applies when Show `Run` lens. Only applies when `#rust-analyzer.lens.enable#` is set.
`#rust-analyzer.lens.enable#` is set.
## rust-analyzer.lens.updateTest.enable {#lens.updateTest.enable} ## rust-analyzer.lens.updateTest.enable {#lens.updateTest.enable}
Default: `true` Default: `true`
Whether to show `Update Test` lens. Only applies when Show `Update Test` lens. Only applies when `#rust-analyzer.lens.enable#` and
`#rust-analyzer.lens.enable#` and `#rust-analyzer.lens.run.enable#` are set. `#rust-analyzer.lens.run.enable#` are set.
## rust-analyzer.linkedProjects {#linkedProjects} ## rust-analyzer.linkedProjects {#linkedProjects}
Default: `[]` Default: `[]`
Disable project auto-discovery in favor of explicitly specified set Disable project auto-discovery in favor of explicitly specified set of projects.
of projects.
Elements must be paths pointing to `Cargo.toml`, Elements must be paths pointing to `Cargo.toml`, `rust-project.json`, `.rs` files (which
`rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON will be treated as standalone files) or JSON objects in `rust-project.json` format.
objects in `rust-project.json` format.
## rust-analyzer.lru.capacity {#lru.capacity} ## rust-analyzer.lru.capacity {#lru.capacity}
@ -1197,21 +1217,22 @@ Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
Default: `{}` Default: `{}`
Sets the LRU capacity of the specified queries. The LRU capacity of the specified queries.
## rust-analyzer.notifications.cargoTomlNotFound {#notifications.cargoTomlNotFound} ## rust-analyzer.notifications.cargoTomlNotFound {#notifications.cargoTomlNotFound}
Default: `true` Default: `true`
Whether to show `can't find Cargo.toml` error message. Show `can't find Cargo.toml` error message.
## rust-analyzer.numThreads {#numThreads} ## rust-analyzer.numThreads {#numThreads}
Default: `null` Default: `null`
How many worker threads in the main loop. The default `null` means to pick automatically. The number of worker threads in the main loop. The default `null` means to pick
automatically.
## rust-analyzer.procMacro.attributes.enable {#procMacro.attributes.enable} ## rust-analyzer.procMacro.attributes.enable {#procMacro.attributes.enable}
@ -1346,7 +1367,10 @@ doc links.
Default: `true` Default: `true`
Whether the server is allowed to emit non-standard tokens and modifiers. Emit non-standard tokens and modifiers
When enabled, rust-analyzer will emit tokens and modifiers that are not part of the
standard set of semantic tokens.
## rust-analyzer.semanticHighlighting.operator.enable {#semanticHighlighting.operator.enable} ## rust-analyzer.semanticHighlighting.operator.enable {#semanticHighlighting.operator.enable}
@ -1427,11 +1451,15 @@ Show documentation.
Default: `"=."` Default: `"=."`
Specify the characters allowed to invoke special on typing triggers. Specify the characters allowed to invoke special on typing triggers.
- typing `=` after `let` tries to smartly add `;` if `=` is followed by an existing expression
- typing `=` after `let` tries to smartly add `;` if `=` is followed by an existing
expression
- typing `=` between two expressions adds `;` when in statement position - typing `=` between two expressions adds `;` when in statement position
- typing `=` to turn an assignment into an equality comparison removes `;` when in expression position - typing `=` to turn an assignment into an equality comparison removes `;` when in
expression position
- typing `.` in a chain method call auto-indents - typing `.` in a chain method call auto-indents
- typing `{` or `(` in front of an expression inserts a closing `}` or `)` after the expression - typing `{` or `(` in front of an expression inserts a closing `}` or `)` after the
expression
- typing `{` in a use item adds a closing `}` in the right place - typing `{` in a use item adds a closing `}` in the right place
- typing `>` to complete a return type `->` will insert a whitespace after it - typing `>` to complete a return type `->` will insert a whitespace after it
- typing `<` in a path or type position inserts a closing `>` after the path or type. - typing `<` in a path or type position inserts a closing `>` after the path or type.
@ -1475,8 +1503,8 @@ Below is an example of a valid configuration:
**Warning**: This format is provisional and subject to change. **Warning**: This format is provisional and subject to change.
[`DiscoverWorkspaceConfig::command`] *must* return a JSON object [`DiscoverWorkspaceConfig::command`] *must* return a JSON object corresponding to
corresponding to `DiscoverProjectData::Finished`: `DiscoverProjectData::Finished`:
```norun ```norun
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone, Deserialize, Serialize)]
@ -1506,12 +1534,11 @@ As JSON, `DiscoverProjectData::Finished` is:
} }
``` ```
It is encouraged, but not required, to use the other variants on It is encouraged, but not required, to use the other variants on `DiscoverProjectData`
`DiscoverProjectData` to provide a more polished end-user experience. to provide a more polished end-user experience.
`DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}`, `DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}`, which will be
which will be substituted with the JSON-serialized form of the following substituted with the JSON-serialized form of the following enum:
enum:
```norun ```norun
#[derive(PartialEq, Clone, Debug, Serialize)] #[derive(PartialEq, Clone, Debug, Serialize)]
@ -1538,11 +1565,10 @@ Similarly, the JSON representation of `DiscoverArgument::Buildfile` is:
} }
``` ```
`DiscoverArgument::Path` is used to find and generate a `rust-project.json`, `DiscoverArgument::Path` is used to find and generate a `rust-project.json`, and
and therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to to update an
to update an existing workspace. As a reference for implementors, existing workspace. As a reference for implementors, buck2's `rust-project` will likely
buck2's `rust-project` will likely be useful: be useful: https://github.com/facebook/buck2/tree/main/integrations/rust-project.
https://github.com/facebook/buck2/tree/main/integrations/rust-project.
## rust-analyzer.workspace.symbol.search.excludeImports {#workspace.symbol.search.excludeImports} ## rust-analyzer.workspace.symbol.search.excludeImports {#workspace.symbol.search.excludeImports}

File diff suppressed because it is too large Load diff