From b84f3cc98f391167e91d9ed4cebd61ea34edcede Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 26 Apr 2022 14:39:06 +0200 Subject: Update docs and config --- docs/user/generated_config.adoc | 376 ++++++++++++++++++++-------------------- 1 file changed, 185 insertions(+), 191 deletions(-) (limited to 'docs/user') diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index ace74f8e08a..c70bf206ffe 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -1,107 +1,56 @@ -[[rust-analyzer.assist.exprFillDefault]]rust-analyzer.assist.exprFillDefault (default: `"todo"`):: +[[rust-analyzer.assist.expressionFillDefault]]rust-analyzer.assist.expressionFillDefault (default: `"todo"`):: + -- Placeholder for missing expressions in assists. -- -[[rust-analyzer.assist.importGranularity]]rust-analyzer.assist.importGranularity (default: `"crate"`):: -+ --- -How imports should be grouped into use statements. --- -[[rust-analyzer.assist.importEnforceGranularity]]rust-analyzer.assist.importEnforceGranularity (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. --- -[[rust-analyzer.assist.importPrefix]]rust-analyzer.assist.importPrefix (default: `"plain"`):: -+ --- -The path structure for newly inserted paths to use. --- -[[rust-analyzer.assist.importGroup]]rust-analyzer.assist.importGroup (default: `true`):: -+ --- -Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines. --- -[[rust-analyzer.assist.allowMergingIntoGlobImports]]rust-analyzer.assist.allowMergingIntoGlobImports (default: `true`):: -+ --- -Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. --- -[[rust-analyzer.cache.warmup]]rust-analyzer.cache.warmup (default: `true`):: -+ --- -Warm up caches on project load. --- -[[rust-analyzer.callInfo.full]]rust-analyzer.callInfo.full (default: `true`):: -+ --- -Show function name and docs in parameter hints. --- [[rust-analyzer.cargo.autoreload]]rust-analyzer.cargo.autoreload (default: `true`):: + -- Automatically refresh project info via `cargo metadata` on `Cargo.toml` changes. -- -[[rust-analyzer.cargo.allFeatures]]rust-analyzer.cargo.allFeatures (default: `false`):: -+ --- -Activate all available features (`--all-features`). --- -[[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`):: -+ --- -Unsets `#[cfg(test)]` for the specified crates. --- -[[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: -+ --- -List of features to activate. --- -[[rust-analyzer.cargo.runBuildScripts]]rust-analyzer.cargo.runBuildScripts (default: `true`):: +[[rust-analyzer.cargo.buildScripts.enable]]rust-analyzer.cargo.buildScripts.enable (default: `true`):: + -- Run build scripts (`build.rs`) for more precise code analysis. -- -[[rust-analyzer.cargo.runBuildScriptsCommand]]rust-analyzer.cargo.runBuildScriptsCommand (default: `null`):: +[[rust-analyzer.cargo.buildScripts.overrideCommand]]rust-analyzer.cargo.buildScripts.overrideCommand (default: `null`):: + -- Advanced option, fully override the command rust-analyzer uses to run build scripts and build procedural macros. The command should include `--message-format=json` or a similar option. -- -[[rust-analyzer.cargo.useRustcWrapperForBuildScripts]]rust-analyzer.cargo.useRustcWrapperForBuildScripts (default: `true`):: +[[rust-analyzer.cargo.buildScripts.useRustcWrapper]]rust-analyzer.cargo.buildScripts.useRustcWrapper (default: `true`):: + -- Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to avoid compiling unnecessary things. -- -[[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`):: +[[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: + -- -Do not activate the `default` feature. +List of features to activate. Set to `"all"` to pass `--all-features` to cargo. -- -[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`):: +[[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`):: + -- -Compilation target (target triple). +Do not activate the `default` feature. -- [[rust-analyzer.cargo.noSysroot]]rust-analyzer.cargo.noSysroot (default: `false`):: + -- Internal config for debugging, disables loading of sysroot crates. -- -[[rust-analyzer.checkOnSave.enable]]rust-analyzer.checkOnSave.enable (default: `true`):: +[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`):: + -- -Run specified `cargo check` command for diagnostics on save. +Compilation target override (target triple). -- -[[rust-analyzer.checkOnSave.allFeatures]]rust-analyzer.checkOnSave.allFeatures (default: `null`):: +[[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`):: + -- -Check with all features (`--all-features`). -Defaults to `#rust-analyzer.cargo.allFeatures#`. +Unsets `#[cfg(test)]` for the specified crates. -- [[rust-analyzer.checkOnSave.allTargets]]rust-analyzer.checkOnSave.allTargets (default: `true`):: + @@ -113,16 +62,10 @@ Check all targets and tests (`--all-targets`). -- Cargo command to use for `cargo check`. -- -[[rust-analyzer.checkOnSave.noDefaultFeatures]]rust-analyzer.checkOnSave.noDefaultFeatures (default: `null`):: -+ --- -Do not activate the `default` feature. --- -[[rust-analyzer.checkOnSave.target]]rust-analyzer.checkOnSave.target (default: `null`):: +[[rust-analyzer.checkOnSave.enable]]rust-analyzer.checkOnSave.enable (default: `true`):: + -- -Check for a specific target. Defaults to -`#rust-analyzer.cargo.target#`. +Run specified `cargo check` command for diagnostics on save. -- [[rust-analyzer.checkOnSave.extraArgs]]rust-analyzer.checkOnSave.extraArgs (default: `[]`):: + @@ -133,7 +76,12 @@ Extra arguments for `cargo check`. + -- List of features to activate. Defaults to -`#rust-analyzer.cargo.features#`. +`#rust-analyzer.cargo.features#`. Set to `"all"` to pass `--all-features` to cargo. +-- +[[rust-analyzer.checkOnSave.noDefaultFeatures]]rust-analyzer.checkOnSave.noDefaultFeatures (default: `null`):: ++ +-- +Do not activate the `default` feature. -- [[rust-analyzer.checkOnSave.overrideCommand]]rust-analyzer.checkOnSave.overrideCommand (default: `null`):: + @@ -142,18 +90,40 @@ Advanced option, fully override the command rust-analyzer uses for checking. The command should include `--message-format=json` or similar option. -- -[[rust-analyzer.completion.addCallArgumentSnippets]]rust-analyzer.completion.addCallArgumentSnippets (default: `true`):: +[[rust-analyzer.checkOnSave.target]]rust-analyzer.checkOnSave.target (default: `null`):: + -- -Whether to add argument snippets when completing functions. -Only applies when `#rust-analyzer.completion.addCallParenthesis#` is set. +Check for a specific target. Defaults to +`#rust-analyzer.cargo.target#`. -- -[[rust-analyzer.completion.addCallParenthesis]]rust-analyzer.completion.addCallParenthesis (default: `true`):: +[[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (default: `true`):: + -- -Whether to add parenthesis when completing functions. +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. -- -[[rust-analyzer.completion.snippets]]rust-analyzer.completion.snippets:: +[[rust-analyzer.completion.autoself.enable]]rust-analyzer.completion.autoself.enable (default: `true`):: ++ +-- +Toggles the additional completions that automatically show method calls and field accesses +with `self` prefixed to them when inside a method. +-- +[[rust-analyzer.completion.callable.snippets]]rust-analyzer.completion.callable.snippets (default: `"fill_arguments"`):: ++ +-- +Whether to add parenthesis and argument snippets when completing function. +-- +[[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`):: ++ +-- +Whether to show postfix snippets like `dbg`, `if`, `not`, etc. +-- +[[rust-analyzer.completion.privateEditable.enable]]rust-analyzer.completion.privateEditable.enable (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. +-- +[[rust-analyzer.completion.snippets.custom]]rust-analyzer.completion.snippets.custom:: + -- Default: @@ -203,44 +173,22 @@ Default: Custom completion snippets. -- -[[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`):: -+ --- -Whether to show postfix snippets like `dbg`, `if`, `not`, etc. --- -[[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (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. --- -[[rust-analyzer.completion.autoself.enable]]rust-analyzer.completion.autoself.enable (default: `true`):: -+ --- -Toggles the additional completions that automatically show method calls and field accesses -with `self` prefixed to them when inside a method. --- -[[rust-analyzer.completion.privateEditable.enable]]rust-analyzer.completion.privateEditable.enable (default: `false`):: +[[rust-analyzer.diagnostics.disabled]]rust-analyzer.diagnostics.disabled (default: `[]`):: + -- -Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position. +List of rust-analyzer diagnostics to disable. -- [[rust-analyzer.diagnostics.enable]]rust-analyzer.diagnostics.enable (default: `true`):: + -- Whether to show native rust-analyzer diagnostics. -- -[[rust-analyzer.diagnostics.enableExperimental]]rust-analyzer.diagnostics.enableExperimental (default: `false`):: +[[rust-analyzer.diagnostics.experimental.enable]]rust-analyzer.diagnostics.experimental.enable (default: `false`):: + -- Whether to show experimental rust-analyzer diagnostics that might have more false positives than usual. -- -[[rust-analyzer.diagnostics.disabled]]rust-analyzer.diagnostics.disabled (default: `[]`):: -+ --- -List of rust-analyzer diagnostics to disable. --- [[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`):: + -- @@ -263,16 +211,6 @@ List of warnings that should be displayed with info severity. The warnings will be indicated by a blue squiggly underline in code and a blue icon in the `Problems Panel`. -- -[[rust-analyzer.experimental.procAttrMacros]]rust-analyzer.experimental.procAttrMacros (default: `true`):: -+ --- -Expand attribute macros. --- -[[rust-analyzer.files.watcher]]rust-analyzer.files.watcher (default: `"client"`):: -+ --- -Controls file watching implementation. --- [[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`):: + -- @@ -280,115 +218,110 @@ These 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.highlightRelated.references]]rust-analyzer.highlightRelated.references (default: `true`):: -+ --- -Enables highlighting of related references while hovering your mouse above any identifier. --- -[[rust-analyzer.highlightRelated.exitPoints]]rust-analyzer.highlightRelated.exitPoints (default: `true`):: +[[rust-analyzer.files.watcher]]rust-analyzer.files.watcher (default: `"client"`):: + -- -Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`). +Controls file watching implementation. -- -[[rust-analyzer.highlightRelated.breakPoints]]rust-analyzer.highlightRelated.breakPoints (default: `true`):: +[[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`):: + -- Enables highlighting of related references while hovering your mouse `break`, `loop`, `while`, or `for` keywords. -- -[[rust-analyzer.highlightRelated.yieldPoints]]rust-analyzer.highlightRelated.yieldPoints (default: `true`):: -+ --- -Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords. --- -[[rust-analyzer.highlighting.strings]]rust-analyzer.highlighting.strings (default: `true`):: +[[rust-analyzer.highlightRelated.exitPoints.enable]]rust-analyzer.highlightRelated.exitPoints.enable (default: `true`):: + -- -Use semantic tokens for strings. - -In some editors (e.g. vscode) semantic tokens override other highlighting grammars. -By disabling semantic tokens for strings, other grammars can be used to highlight -their contents. +Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`). -- -[[rust-analyzer.hover.documentation]]rust-analyzer.hover.documentation (default: `true`):: +[[rust-analyzer.highlightRelated.references.enable]]rust-analyzer.highlightRelated.references.enable (default: `true`):: + -- -Whether to show documentation on hover. +Enables highlighting of related references while hovering your mouse above any identifier. -- -[[rust-analyzer.hover.linksInHover]]rust-analyzer.hover.linksInHover (default: `true`):: +[[rust-analyzer.highlightRelated.yieldPoints.enable]]rust-analyzer.highlightRelated.yieldPoints.enable (default: `true`):: + -- -Use markdown syntax for links in hover. +Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords. -- -[[rust-analyzer.hoverActions.debug]]rust-analyzer.hoverActions.debug (default: `true`):: +[[rust-analyzer.hover.actions.debug.enable]]rust-analyzer.hover.actions.debug.enable (default: `true`):: + -- Whether to show `Debug` action. Only applies when `#rust-analyzer.hoverActions.enable#` is set. -- -[[rust-analyzer.hoverActions.enable]]rust-analyzer.hoverActions.enable (default: `true`):: +[[rust-analyzer.hover.actions.enable]]rust-analyzer.hover.actions.enable (default: `true`):: + -- Whether to show HoverActions in Rust files. -- -[[rust-analyzer.hoverActions.gotoTypeDef]]rust-analyzer.hoverActions.gotoTypeDef (default: `true`):: +[[rust-analyzer.hover.actions.gotoTypeDef.enable]]rust-analyzer.hover.actions.gotoTypeDef.enable (default: `true`):: + -- Whether to show `Go to Type Definition` action. Only applies when `#rust-analyzer.hoverActions.enable#` is set. -- -[[rust-analyzer.hoverActions.implementations]]rust-analyzer.hoverActions.implementations (default: `true`):: +[[rust-analyzer.hover.actions.implementations.enable]]rust-analyzer.hover.actions.implementations.enable (default: `true`):: + -- Whether to show `Implementations` action. Only applies when `#rust-analyzer.hoverActions.enable#` is set. -- -[[rust-analyzer.hoverActions.references]]rust-analyzer.hoverActions.references (default: `false`):: +[[rust-analyzer.hover.actions.references.enable]]rust-analyzer.hover.actions.references.enable (default: `false`):: + -- Whether to show `References` action. Only applies when `#rust-analyzer.hoverActions.enable#` is set. -- -[[rust-analyzer.hoverActions.run]]rust-analyzer.hoverActions.run (default: `true`):: +[[rust-analyzer.hover.actions.run.enable]]rust-analyzer.hover.actions.run.enable (default: `true`):: + -- Whether to show `Run` action. Only applies when `#rust-analyzer.hoverActions.enable#` is set. -- -[[rust-analyzer.inlayHints.renderColons]]rust-analyzer.inlayHints.renderColons (default: `true`):: +[[rust-analyzer.hover.documentation.enable]]rust-analyzer.hover.documentation.enable (default: `true`):: + -- -Whether to render trailing colons for parameter hints, and trailing colons for parameter hints. +Whether to show documentation on hover. -- -[[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`):: +[[rust-analyzer.hover.links.enable]]rust-analyzer.hover.links.enable (default: `true`):: + -- -Maximum length for inlay hints. Set to null to have an unlimited length. +Use markdown syntax for links in hover. -- -[[rust-analyzer.inlayHints.parameterHints]]rust-analyzer.inlayHints.parameterHints (default: `true`):: +[[rust-analyzer.imports.enforceGranularity]]rust-analyzer.imports.enforceGranularity (default: `false`):: + -- -Whether to show function parameter name inlay hints at the call -site. +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. -- -[[rust-analyzer.inlayHints.typeHints]]rust-analyzer.inlayHints.typeHints (default: `true`):: +[[rust-analyzer.imports.granularity]]rust-analyzer.imports.granularity (default: `"crate"`):: + -- -Whether to show inlay type hints for variables. +How imports should be grouped into use statements. -- -[[rust-analyzer.inlayHints.chainingHints]]rust-analyzer.inlayHints.chainingHints (default: `true`):: +[[rust-analyzer.imports.group]]rust-analyzer.imports.group (default: `true`):: + -- -Whether to show inlay type hints for method chains. +Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines. -- -[[rust-analyzer.inlayHints.closureReturnTypeHints]]rust-analyzer.inlayHints.closureReturnTypeHints (default: `false`):: +[[rust-analyzer.imports.mergeIntoGlob]]rust-analyzer.imports.mergeIntoGlob (default: `true`):: + -- -Whether to show inlay type hints for return types of closures with blocks. +Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. -- -[[rust-analyzer.inlayHints.reborrowHints]]rust-analyzer.inlayHints.reborrowHints (default: `false`):: +[[rust-analyzer.imports.prefix]]rust-analyzer.imports.prefix (default: `"plain"`):: + -- -Whether to show inlay type hints for compiler inserted reborrows. +The path structure for newly inserted paths to use. +-- +[[rust-analyzer.inlayHints.chainingHints.enable]]rust-analyzer.inlayHints.chainingHints.enable (default: `true`):: ++ +-- +Whether to show inlay type hints for method chains. +-- +[[rust-analyzer.inlayHints.closureReturnTypeHints.enable]]rust-analyzer.inlayHints.closureReturnTypeHints.enable (default: `false`):: ++ +-- +Whether to show inlay type hints for return types of closures with blocks. -- [[rust-analyzer.inlayHints.lifetimeElisionHints.enable]]rust-analyzer.inlayHints.lifetimeElisionHints.enable (default: `"never"`):: + @@ -400,11 +333,42 @@ Whether to show inlay type hints for elided lifetimes in function signatures. -- Whether to prefer using parameter names as the name for elided lifetime hints if possible. -- -[[rust-analyzer.inlayHints.hideNamedConstructorHints]]rust-analyzer.inlayHints.hideNamedConstructorHints (default: `false`):: +[[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`):: ++ +-- +Maximum length for inlay hints. Set to null to have an unlimited length. +-- +[[rust-analyzer.inlayHints.parameterHints.enable]]rust-analyzer.inlayHints.parameterHints.enable (default: `true`):: ++ +-- +Whether to show function parameter name inlay hints at the call +site. +-- +[[rust-analyzer.inlayHints.reborrowHints.enable]]rust-analyzer.inlayHints.reborrowHints.enable (default: `false`):: ++ +-- +Whether to show inlay type hints for compiler inserted reborrows. +-- +[[rust-analyzer.inlayHints.renderColons]]rust-analyzer.inlayHints.renderColons (default: `true`):: ++ +-- +Whether to render trailing colons for parameter hints, and trailing colons for parameter hints. +-- +[[rust-analyzer.inlayHints.typeHints.enable]]rust-analyzer.inlayHints.typeHints.enable (default: `true`):: ++ +-- +Whether to show inlay type hints for variables. +-- +[[rust-analyzer.inlayHints.typeHints.hideNamedConstructor]]rust-analyzer.inlayHints.typeHints.hideNamedConstructor (default: `false`):: + -- Whether to hide inlay hints for constructors. -- +[[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`):: ++ +-- +Join lines merges consecutive declaration and initialization of an assignment. +-- [[rust-analyzer.joinLines.joinElseIf]]rust-analyzer.joinLines.joinElseIf (default: `true`):: + -- @@ -420,12 +384,7 @@ Join lines removes trailing commas. -- Join lines unwraps trivial blocks. -- -[[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`):: -+ --- -Join lines merges consecutive declaration and initialization of an assignment. --- -[[rust-analyzer.lens.debug]]rust-analyzer.lens.debug (default: `true`):: +[[rust-analyzer.lens.debug.enable]]rust-analyzer.lens.debug.enable (default: `true`):: + -- Whether to show `Debug` lens. Only applies when @@ -436,41 +395,47 @@ Whether to show `Debug` lens. Only applies when -- Whether to show CodeLens in Rust files. -- -[[rust-analyzer.lens.implementations]]rust-analyzer.lens.implementations (default: `true`):: +[[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`):: + -- -Whether to show `Implementations` lens. Only applies when -`#rust-analyzer.lens.enable#` is set. +Internal config: use custom client-side commands even when the +client doesn't set the corresponding capability. -- -[[rust-analyzer.lens.run]]rust-analyzer.lens.run (default: `true`):: +[[rust-analyzer.lens.implementations.enable]]rust-analyzer.lens.implementations.enable (default: `true`):: + -- -Whether to show `Run` lens. Only applies when +Whether to show `Implementations` lens. Only applies when `#rust-analyzer.lens.enable#` is set. -- -[[rust-analyzer.lens.methodReferences]]rust-analyzer.lens.methodReferences (default: `false`):: +[[rust-analyzer.lens.references.adt.enable]]rust-analyzer.lens.references.adt.enable (default: `false`):: + -- -Whether to show `Method References` lens. Only applies when -`#rust-analyzer.lens.enable#` is set. +Whether to show `References` lens for Struct, Enum, and Union. +Only applies when `#rust-analyzer.lens.enable#` is set. -- -[[rust-analyzer.lens.references]]rust-analyzer.lens.references (default: `false`):: +[[rust-analyzer.lens.references.adt.variant.enable]]rust-analyzer.lens.references.adt.variant.enable (default: `false`):: + -- -Whether to show `References` lens for Struct, Enum, Union and Trait. +Whether to show `References` lens for Enum Variants. Only applies when `#rust-analyzer.lens.enable#` is set. -- -[[rust-analyzer.lens.enumVariantReferences]]rust-analyzer.lens.enumVariantReferences (default: `false`):: +[[rust-analyzer.lens.references.method.enable]]rust-analyzer.lens.references.method.enable (default: `false`):: + -- -Whether to show `References` lens for Enum Variants. +Whether to show `Method References` lens. Only applies when +`#rust-analyzer.lens.enable#` is set. +-- +[[rust-analyzer.lens.references.trait.enable]]rust-analyzer.lens.references.trait.enable (default: `false`):: ++ +-- +Whether to show `References` lens for Trait. Only applies when `#rust-analyzer.lens.enable#` is set. -- -[[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`):: +[[rust-analyzer.lens.run.enable]]rust-analyzer.lens.run.enable (default: `true`):: + -- -Internal config: use custom client-side commands even when the -client doesn't set the corresponding capability. +Whether to show `Run` lens. Only applies when +`#rust-analyzer.lens.enable#` is set. -- [[rust-analyzer.linkedProjects]]rust-analyzer.linkedProjects (default: `[]`):: + @@ -481,7 +446,7 @@ of projects. Elements must be paths pointing to `Cargo.toml`, `rust-project.json`, or JSON objects in `rust-project.json` format. -- -[[rust-analyzer.lruCapacity]]rust-analyzer.lruCapacity (default: `null`):: +[[rust-analyzer.lru.capacity]]rust-analyzer.lru.capacity (default: `null`):: + -- Number of syntax trees rust-analyzer keeps in memory. Defaults to 128. @@ -491,21 +456,25 @@ Number of syntax trees rust-analyzer keeps in memory. Defaults to 128. -- Whether to show `can't find Cargo.toml` error message. -- +[[rust-analyzer.primeCaches.enable]]rust-analyzer.primeCaches.enable (default: `true`):: ++ +-- +Warm up caches on project load. +-- [[rust-analyzer.primeCaches.numThreads]]rust-analyzer.primeCaches.numThreads (default: `0`):: + -- How many worker threads to to handle priming caches. The default `0` means to pick automatically. -- -[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`):: +[[rust-analyzer.procMacro.attributes.enable]]rust-analyzer.procMacro.attributes.enable (default: `true`):: + -- -Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`. +Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set. -- -[[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`):: +[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`):: + -- -Internal config, path to proc-macro server executable (typically, -this is rust-analyzer itself, but we override this in tests). +Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`. -- [[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`):: + @@ -514,18 +483,24 @@ These proc-macros will be ignored when trying to expand them. This config takes a map of crate names with the exported proc-macro names to ignore as values. -- -[[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`):: +[[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`):: ++ +-- +Internal config, path to proc-macro server executable (typically, +this is rust-analyzer itself, but we override this in tests). +-- +[[rust-analyzer.runnables.command]]rust-analyzer.runnables.command (default: `null`):: + -- Command to be executed instead of 'cargo' for runnables. -- -[[rust-analyzer.runnables.cargoExtraArgs]]rust-analyzer.runnables.cargoExtraArgs (default: `[]`):: +[[rust-analyzer.runnables.extraArgs]]rust-analyzer.runnables.extraArgs (default: `[]`):: + -- Additional arguments to be passed to cargo for runnables such as tests or binaries. For example, it may be `--release`. -- -[[rust-analyzer.rustcSource]]rust-analyzer.rustcSource (default: `null`):: +[[rust-analyzer.rustc.source]]rust-analyzer.rustc.source (default: `null`):: + -- Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private @@ -548,17 +523,31 @@ Additional arguments to `rustfmt`. Advanced option, fully override the command rust-analyzer uses for formatting. -- -[[rust-analyzer.rustfmt.enableRangeFormatting]]rust-analyzer.rustfmt.enableRangeFormatting (default: `false`):: +[[rust-analyzer.rustfmt.rangeFormatting.enable]]rust-analyzer.rustfmt.rangeFormatting.enable (default: `false`):: + -- Enables the use of rustfmt's unstable range formatting command for the `textDocument/rangeFormatting` request. The rustfmt option is unstable and only available on a nightly build. -- -[[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`):: +[[rust-analyzer.semanticHighlighting.strings.enable]]rust-analyzer.semanticHighlighting.strings.enable (default: `true`):: + -- -Workspace symbol search scope. +Use semantic tokens for strings. + +In some editors (e.g. vscode) semantic tokens override other highlighting grammars. +By disabling semantic tokens for strings, other grammars can be used to highlight +their contents. +-- +[[rust-analyzer.signatureInfo.documentation.enable]]rust-analyzer.signatureInfo.documentation.enable (default: `true`):: ++ +-- +Show documentation. +-- +[[rust-analyzer.signatureInfo.signature.enable]]rust-analyzer.signatureInfo.signature.enable (default: `true`):: ++ +-- +Show full signature of the callable. Only shows parameters if disabled. -- [[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`):: + @@ -572,3 +561,8 @@ Limits the number of items returned from a workspace symbol search (Defaults to Some clients like vs-code issue new searches on result filtering and don't require all results to be returned in the initial search. Other clients requires all results upfront and might require a higher limit. -- +[[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`):: ++ +-- +Workspace symbol search scope. +-- -- cgit 1.4.1-3-g733a5 From 3d17261972fcf5f55660a6e2889608142426d5c3 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 27 Apr 2022 17:51:44 +0200 Subject: Adjust signature info and enum variant lenses --- crates/rust-analyzer/src/config.rs | 25 ++++++++++++++++++++----- docs/user/generated_config.adoc | 10 +++++----- editors/code/package.json | 20 ++++++++++++++------ 3 files changed, 39 insertions(+), 16 deletions(-) (limited to 'docs/user') diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 413cb91af2a..7dc25c1e6d7 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -272,7 +272,7 @@ config_data! { lens_references_adt_enable: bool = "false", /// Whether to show `References` lens for Enum Variants. /// Only applies when `#rust-analyzer.lens.enable#` is set. - lens_references_adt_variant_enable: bool = "false", + lens_references_enumVariant_enable: bool = "false", /// Whether to show `Method References` lens. Only applies when /// `#rust-analyzer.lens.enable#` is set. lens_references_method_enable: bool = "false", @@ -346,10 +346,10 @@ config_data! { /// their contents. semanticHighlighting_strings_enable: bool = "true", + /// Show full signature of the callable. Only shows parameters if disabled. + signatureInfo_detail: SignatureDetail = "\"full\"", /// Show documentation. signatureInfo_documentation_enable: bool = "true", - /// Show full signature of the callable. Only shows parameters if disabled. - signatureInfo_signature_enable: bool = "true", /// Workspace symbol search kind. workspace_symbol_search_kind: WorkspaceSymbolSearchKindDef = "\"only_types\"", @@ -1041,7 +1041,7 @@ impl Config { pub fn call_info(&self) -> CallInfoConfig { CallInfoConfig { - params_only: self.data.signatureInfo_signature_enable, + params_only: matches!(self.data.signatureInfo_detail, SignatureDetail::Parameters), docs: self.data.signatureInfo_documentation_enable, } } @@ -1055,7 +1055,7 @@ impl Config { refs_adt: self.data.lens_enable && self.data.lens_references_adt_enable, refs_trait: self.data.lens_enable && self.data.lens_references_trait_enable, enum_variant_refs: self.data.lens_enable - && self.data.lens_references_adt_variant_enable, + && self.data.lens_references_enumVariant_enable, } } @@ -1365,6 +1365,13 @@ enum WorkspaceSymbolSearchScopeDef { WorkspaceAndDependencies, } +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "snake_case")] +enum SignatureDetail { + Full, + Parameters, +} + #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "snake_case")] enum WorkspaceSymbolSearchKindDef { @@ -1637,6 +1644,14 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json "Add call parentheses", ], }, + "SignatureDetail" => set! { + "type": "string", + "enum": ["full", "parameters"], + "enumDescriptions": [ + "Show the entire signature.", + "Show only the parameters." + ], + }, _ => panic!("missing entry for {}: {}", ty, default), } diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index c70bf206ffe..ab9f7db8847 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -413,7 +413,7 @@ Whether to show `Implementations` lens. Only applies when Whether to show `References` lens for Struct, Enum, and Union. Only applies when `#rust-analyzer.lens.enable#` is set. -- -[[rust-analyzer.lens.references.adt.variant.enable]]rust-analyzer.lens.references.adt.variant.enable (default: `false`):: +[[rust-analyzer.lens.references.enumVariant.enable]]rust-analyzer.lens.references.enumVariant.enable (default: `false`):: + -- Whether to show `References` lens for Enum Variants. @@ -539,15 +539,15 @@ In some editors (e.g. vscode) semantic tokens override other highlighting gramma By disabling semantic tokens for strings, other grammars can be used to highlight their contents. -- -[[rust-analyzer.signatureInfo.documentation.enable]]rust-analyzer.signatureInfo.documentation.enable (default: `true`):: +[[rust-analyzer.signatureInfo.detail]]rust-analyzer.signatureInfo.detail (default: `"full"`):: + -- -Show documentation. +Show full signature of the callable. Only shows parameters if disabled. -- -[[rust-analyzer.signatureInfo.signature.enable]]rust-analyzer.signatureInfo.signature.enable (default: `true`):: +[[rust-analyzer.signatureInfo.documentation.enable]]rust-analyzer.signatureInfo.documentation.enable (default: `true`):: + -- -Show full signature of the callable. Only shows parameters if disabled. +Show documentation. -- [[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`):: + diff --git a/editors/code/package.json b/editors/code/package.json index c4e7036a3ce..df5d9b36090 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -873,7 +873,7 @@ "default": false, "type": "boolean" }, - "rust-analyzer.lens.references.adt.variant.enable": { + "rust-analyzer.lens.references.enumVariant.enable": { "markdownDescription": "Whether to show `References` lens for Enum Variants.\nOnly applies when `#rust-analyzer.lens.enable#` is set.", "default": false, "type": "boolean" @@ -1006,16 +1006,24 @@ "default": true, "type": "boolean" }, + "rust-analyzer.signatureInfo.detail": { + "markdownDescription": "Show full signature of the callable. Only shows parameters if disabled.", + "default": "full", + "type": "string", + "enum": [ + "full", + "parameters" + ], + "enumDescriptions": [ + "Show the entire signature.", + "Show only the parameters." + ] + }, "rust-analyzer.signatureInfo.documentation.enable": { "markdownDescription": "Show documentation.", "default": true, "type": "boolean" }, - "rust-analyzer.signatureInfo.signature.enable": { - "markdownDescription": "Show full signature of the callable. Only shows parameters if disabled.", - "default": true, - "type": "boolean" - }, "rust-analyzer.workspace.symbol.search.kind": { "markdownDescription": "Workspace symbol search kind.", "default": "only_types", -- cgit 1.4.1-3-g733a5 From 1f11b70c3bcbdd1481d00344ccf4da9cdca2a572 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 29 Apr 2022 10:56:32 +0200 Subject: Final fixups --- crates/rust-analyzer/src/config.rs | 21 +++++++++++---------- docs/user/generated_config.adoc | 8 ++++---- editors/code/package.json | 8 ++++---- 3 files changed, 19 insertions(+), 18 deletions(-) (limited to 'docs/user') diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 1af59cfebee..64eb16fbcaa 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -37,6 +37,7 @@ use crate::{ // Conventions for configuration keys to preserve maximal extendability without breakage: // - Toggles (be it binary true/false or with more options in-between) should almost always suffix as `_enable` +// This has the benefit of namespaces being extensible, and if the suffix doesn't fit later it can be changed without breakage. // - In general be wary of using the namespace of something verbatim, it prevents us from adding subkeys in the future // - Don't use abbreviations unless really necessary // - foo_command = overrides the subcommand, foo_overrideCommand allows full overwriting, extra args only applies for foo_command @@ -58,7 +59,7 @@ config_data! { /// `Cargo.toml` changes. cargo_autoreload: bool = "true", /// Run build scripts (`build.rs`) for more precise code analysis. - cargo_buildScripts_enable: bool = "true", + cargo_buildScripts_enable: bool = "true", /// Advanced option, fully override the command rust-analyzer uses to /// run build scripts and build procedural macros. The command should /// include `--message-format=json` or a similar option. @@ -87,7 +88,7 @@ config_data! { checkOnSave_extraArgs: Vec = "[]", /// List of features to activate. Defaults to /// `#rust-analyzer.cargo.features#`. Set to `"all"` to pass `--all-features` to cargo. - checkOnSave_features: Option = "null", + checkOnSave_features: Option = "null", /// Do not activate the `default` feature. checkOnSave_noDefaultFeatures: Option = "null", /// Advanced option, fully override the command rust-analyzer uses for @@ -215,13 +216,13 @@ config_data! { hover_links_enable: bool = "true", /// 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. - imports_enforceGranularity: bool = "false", + imports_granularity_enforce: bool = "false", /// How imports should be grouped into use statements. - imports_granularity: ImportGranularityDef = "\"crate\"", + imports_granularity_group: ImportGranularityDef = "\"crate\"", /// Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines. - imports_group: 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::*;`. - imports_mergeIntoGlob: bool = "true", + imports_merge_glob: bool = "true", /// The path structure for newly inserted paths to use. imports_prefix: ImportPrefixDef = "\"plain\"", @@ -976,20 +977,20 @@ impl Config { fn insert_use_config(&self) -> InsertUseConfig { InsertUseConfig { - granularity: match self.data.imports_granularity { + granularity: match self.data.imports_granularity_group { ImportGranularityDef::Preserve => ImportGranularity::Preserve, ImportGranularityDef::Item => ImportGranularity::Item, ImportGranularityDef::Crate => ImportGranularity::Crate, ImportGranularityDef::Module => ImportGranularity::Module, }, - enforce_granularity: self.data.imports_enforceGranularity, + enforce_granularity: self.data.imports_granularity_enforce, prefix_kind: match self.data.imports_prefix { ImportPrefixDef::Plain => PrefixKind::Plain, ImportPrefixDef::ByCrate => PrefixKind::ByCrate, ImportPrefixDef::BySelf => PrefixKind::BySelf, }, - group: self.data.imports_group, - skip_glob_imports: !self.data.imports_mergeIntoGlob, + group: self.data.imports_group_enable, + skip_glob_imports: !self.data.imports_merge_glob, } } diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index ab9f7db8847..81bab6fd2d3 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -288,22 +288,22 @@ Whether to show documentation on hover. -- Use markdown syntax for links in hover. -- -[[rust-analyzer.imports.enforceGranularity]]rust-analyzer.imports.enforceGranularity (default: `false`):: +[[rust-analyzer.imports.granularity.enforce]]rust-analyzer.imports.granularity.enforce (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. -- -[[rust-analyzer.imports.granularity]]rust-analyzer.imports.granularity (default: `"crate"`):: +[[rust-analyzer.imports.granularity.group]]rust-analyzer.imports.granularity.group (default: `"crate"`):: + -- How imports should be grouped into use statements. -- -[[rust-analyzer.imports.group]]rust-analyzer.imports.group (default: `true`):: +[[rust-analyzer.imports.group.enable]]rust-analyzer.imports.group.enable (default: `true`):: + -- Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines. -- -[[rust-analyzer.imports.mergeIntoGlob]]rust-analyzer.imports.mergeIntoGlob (default: `true`):: +[[rust-analyzer.imports.merge.glob]]rust-analyzer.imports.merge.glob (default: `true`):: + -- Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. diff --git a/editors/code/package.json b/editors/code/package.json index df5d9b36090..79df7bdf3e4 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -714,12 +714,12 @@ "default": true, "type": "boolean" }, - "rust-analyzer.imports.enforceGranularity": { + "rust-analyzer.imports.granularity.enforce": { "markdownDescription": "Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.", "default": false, "type": "boolean" }, - "rust-analyzer.imports.granularity": { + "rust-analyzer.imports.granularity.group": { "markdownDescription": "How imports should be grouped into use statements.", "default": "crate", "type": "string", @@ -736,12 +736,12 @@ "Flatten imports so that each has its own use statement." ] }, - "rust-analyzer.imports.group": { + "rust-analyzer.imports.group.enable": { "markdownDescription": "Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are separated by newlines.", "default": true, "type": "boolean" }, - "rust-analyzer.imports.mergeIntoGlob": { + "rust-analyzer.imports.merge.glob": { "markdownDescription": "Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.", "default": true, "type": "boolean" -- cgit 1.4.1-3-g733a5 From 291f94e22e4ef3a9c61dbd40728c9f8cef34f886 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 29 Apr 2022 15:48:48 +0200 Subject: Fix up config docs --- crates/hir-expand/src/builtin_fn_macro.rs | 2 +- crates/ide-diagnostics/src/handlers/macro_error.rs | 4 +- crates/rust-analyzer/src/config.rs | 61 +++++++++++++++------- docs/user/generated_config.adoc | 53 +++++++++++++------ editors/code/package.json | 24 ++++----- 5 files changed, 93 insertions(+), 51 deletions(-) (limited to 'docs/user') diff --git a/crates/hir-expand/src/builtin_fn_macro.rs b/crates/hir-expand/src/builtin_fn_macro.rs index 8d2352f06ed..aa09912f302 100644 --- a/crates/hir-expand/src/builtin_fn_macro.rs +++ b/crates/hir-expand/src/builtin_fn_macro.rs @@ -641,7 +641,7 @@ fn env_expand( // unnecessary diagnostics for eg. `CARGO_PKG_NAME`. if key == "OUT_DIR" { err = Some(ExpandError::Other( - r#"`OUT_DIR` not set, enable "run build scripts" to fix"#.into(), + r#"`OUT_DIR` not set, enable "build scripts" to fix"#.into(), )); } diff --git a/crates/ide-diagnostics/src/handlers/macro_error.rs b/crates/ide-diagnostics/src/handlers/macro_error.rs index a5bfb302d5e..53d0131e02d 100644 --- a/crates/ide-diagnostics/src/handlers/macro_error.rs +++ b/crates/ide-diagnostics/src/handlers/macro_error.rs @@ -111,7 +111,7 @@ macro_rules! env { () => {} } macro_rules! concat { () => {} } include!(concat!(env!("OUT_DIR"), "/out.rs")); -//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `OUT_DIR` not set, enable "run build scripts" to fix +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `OUT_DIR` not set, enable "build scripts" to fix "#, ); } @@ -161,7 +161,7 @@ fn main() { //^^^^^^^^^^^^^ error: could not convert tokens env!("OUT_DIR"); - //^^^^^^^^^^^^^^^ error: `OUT_DIR` not set, enable "run build scripts" to fix + //^^^^^^^^^^^^^^^ error: `OUT_DIR` not set, enable "build scripts" to fix compile_error!("compile_error works"); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: compile_error works diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index c7f939f36aa..75c1a31e934 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -52,7 +52,7 @@ use crate::{ // parsing the old name. config_data! { struct ConfigData { - /// Placeholder for missing expressions in assists. + /// Placeholder expression to use for missing expressions in assists. assist_expressionFillDefault: ExprFillDefaultDef = "\"todo\"", /// Automatically refresh project info via `cargo metadata` on @@ -60,16 +60,27 @@ config_data! { cargo_autoreload: bool = "true", /// Run build scripts (`build.rs`) for more precise code analysis. cargo_buildScripts_enable: bool = "true", - /// Advanced option, fully override the command rust-analyzer uses to - /// run build scripts and build procedural macros. The command should - /// include `--message-format=json` or a similar option. + /// Override the command rust-analyzer uses to run build scripts and + /// build procedural macros. The command is required to output json + /// and should therefor include `--message-format=json` or a similar + /// option. + /// + /// By default, a cargo invocation will be constructed for the configured + /// targets and features, with the following base command line: + /// + /// ```bash + /// cargo check --quiet --workspace --message-format=json --all-targets + /// ``` + /// . cargo_buildScripts_overrideCommand: Option> = "null", /// Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to /// avoid compiling unnecessary things. cargo_buildScripts_useRustcWrapper: bool = "true", - /// List of features to activate. Set to `"all"` to pass `--all-features` to cargo. + /// List of features to activate. + /// + /// Set this to `"all"` to pass `--all-features` to cargo. cargo_features: CargoFeatures = "[]", - /// Do not activate the `default` feature. + /// Whether to pass `--no-default-features` to cargo. cargo_noDefaultFeatures: bool = "false", /// Internal config for debugging, disables loading of sysroot crates. cargo_noSysroot: bool = "false", @@ -87,13 +98,23 @@ config_data! { /// Extra arguments for `cargo check`. checkOnSave_extraArgs: Vec = "[]", /// List of features to activate. Defaults to - /// `#rust-analyzer.cargo.features#`. Set to `"all"` to pass `--all-features` to cargo. + /// `#rust-analyzer.cargo.features#`. + /// + /// Set to `"all"` to pass `--all-features` to cargo. checkOnSave_features: Option = "null", /// Do not activate the `default` feature. checkOnSave_noDefaultFeatures: Option = "null", - /// Advanced option, fully override the command rust-analyzer uses for - /// checking. The command should include `--message-format=json` or - /// similar option. + /// Override the command rust-analyzer uses to run build scripts and + /// build procedural macros. The command is required to output json + /// and should therefor include `--message-format=json` or a similar + /// option. + /// + /// An example command would be: + /// + /// ```bash + /// cargo check --workspace --message-format=json --all-targets + /// ``` + /// . checkOnSave_overrideCommand: Option> = "null", /// Check for a specific target. Defaults to /// `#rust-analyzer.cargo.target#`. @@ -183,13 +204,13 @@ config_data! { /// Controls file watching implementation. files_watcher: String = "\"client\"", - /// Enables highlighting of related references while hovering your mouse `break`, `loop`, `while`, or `for` keywords. + /// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords. highlightRelated_breakPoints_enable: bool = "true", - /// Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`). + /// Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`). highlightRelated_exitPoints_enable: bool = "true", - /// Enables highlighting of related references while hovering your mouse above any identifier. + /// Enables highlighting of related references while the cursor is on any identifier. highlightRelated_references_enable: bool = "true", - /// Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords. + /// Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords. highlightRelated_yieldPoints_enable: bool = "true", /// Whether to show `Debug` action. Only applies when @@ -233,20 +254,20 @@ config_data! { /// Whether to show inlay type hints for elided lifetimes in function signatures. inlayHints_lifetimeElisionHints_enable: LifetimeElisionDef = "\"never\"", /// Whether to 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. - inlayHints_maxLength: Option = "25", + inlayHints_maxLength: Option = "25", /// Whether to show function parameter name inlay hints at the call /// site. inlayHints_parameterHints_enable: bool = "true", /// Whether to show inlay type hints for compiler inserted reborrows. inlayHints_reborrowHints_enable: bool = "false", /// Whether to render trailing colons for parameter hints, and trailing colons for parameter hints. - inlayHints_renderColons: bool = "true", + inlayHints_renderColons: bool = "true", /// Whether to show inlay type hints for variables. inlayHints_typeHints_enable: bool = "true", - /// Whether to hide inlay hints for constructors. - inlayHints_typeHints_hideNamedConstructor: bool = "false", + /// Whether to hide inlay type hints for constructors. + inlayHints_typeHints_hideNamedConstructor: bool = "false", /// Join lines merges consecutive declaration and initialization of an assignment. joinLines_joinAssignments: bool = "true", @@ -304,7 +325,7 @@ config_data! { /// Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set. procMacro_attributes_enable: bool = "true", - /// Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`. + /// Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`. procMacro_enable: bool = "true", /// These proc-macros will be ignored when trying to expand them. /// diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index 81bab6fd2d3..c3fc4096a26 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -1,7 +1,7 @@ [[rust-analyzer.assist.expressionFillDefault]]rust-analyzer.assist.expressionFillDefault (default: `"todo"`):: + -- -Placeholder for missing expressions in assists. +Placeholder expression to use for missing expressions in assists. -- [[rust-analyzer.cargo.autoreload]]rust-analyzer.cargo.autoreload (default: `true`):: + @@ -17,9 +17,18 @@ Run build scripts (`build.rs`) for more precise code analysis. [[rust-analyzer.cargo.buildScripts.overrideCommand]]rust-analyzer.cargo.buildScripts.overrideCommand (default: `null`):: + -- -Advanced option, fully override the command rust-analyzer uses to -run build scripts and build procedural macros. The command should -include `--message-format=json` or a similar option. +Override the command rust-analyzer uses to run build scripts and +build procedural macros. The command is required to output json +and should therefor include `--message-format=json` or a similar +option. + +By default, a cargo invocation will be constructed for the configured +targets and features, with the following base command line: + +```bash +cargo check --quiet --workspace --message-format=json --all-targets +``` +. -- [[rust-analyzer.cargo.buildScripts.useRustcWrapper]]rust-analyzer.cargo.buildScripts.useRustcWrapper (default: `true`):: + @@ -30,12 +39,14 @@ avoid compiling unnecessary things. [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: + -- -List of features to activate. Set to `"all"` to pass `--all-features` to cargo. +List of features to activate. + +Set this to `"all"` to pass `--all-features` to cargo. -- [[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`):: + -- -Do not activate the `default` feature. +Whether to pass `--no-default-features` to cargo. -- [[rust-analyzer.cargo.noSysroot]]rust-analyzer.cargo.noSysroot (default: `false`):: + @@ -76,7 +87,9 @@ Extra arguments for `cargo check`. + -- List of features to activate. Defaults to -`#rust-analyzer.cargo.features#`. Set to `"all"` to pass `--all-features` to cargo. +`#rust-analyzer.cargo.features#`. + +Set to `"all"` to pass `--all-features` to cargo. -- [[rust-analyzer.checkOnSave.noDefaultFeatures]]rust-analyzer.checkOnSave.noDefaultFeatures (default: `null`):: + @@ -86,9 +99,17 @@ Do not activate the `default` feature. [[rust-analyzer.checkOnSave.overrideCommand]]rust-analyzer.checkOnSave.overrideCommand (default: `null`):: + -- -Advanced option, fully override the command rust-analyzer uses for -checking. The command should include `--message-format=json` or -similar option. +Override the command rust-analyzer uses to run build scripts and +build procedural macros. The command is required to output json +and should therefor include `--message-format=json` or a similar +option. + +An example command would be: + +```bash +cargo check --workspace --message-format=json --all-targets +``` +. -- [[rust-analyzer.checkOnSave.target]]rust-analyzer.checkOnSave.target (default: `null`):: + @@ -226,22 +247,22 @@ Controls file watching implementation. [[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`):: + -- -Enables highlighting of related references while hovering your mouse `break`, `loop`, `while`, or `for` keywords. +Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords. -- [[rust-analyzer.highlightRelated.exitPoints.enable]]rust-analyzer.highlightRelated.exitPoints.enable (default: `true`):: + -- -Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`). +Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`). -- [[rust-analyzer.highlightRelated.references.enable]]rust-analyzer.highlightRelated.references.enable (default: `true`):: + -- -Enables highlighting of related references while hovering your mouse above any identifier. +Enables highlighting of related references while the cursor is on any identifier. -- [[rust-analyzer.highlightRelated.yieldPoints.enable]]rust-analyzer.highlightRelated.yieldPoints.enable (default: `true`):: + -- -Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords. +Enables highlighting of 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]]rust-analyzer.hover.actions.debug.enable (default: `true`):: + @@ -362,7 +383,7 @@ Whether to show inlay type hints for variables. [[rust-analyzer.inlayHints.typeHints.hideNamedConstructor]]rust-analyzer.inlayHints.typeHints.hideNamedConstructor (default: `false`):: + -- -Whether to hide inlay hints for constructors. +Whether to hide inlay type hints for constructors. -- [[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`):: + @@ -474,7 +495,7 @@ Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set. [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`):: + -- -Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`. +Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`. -- [[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`):: + diff --git a/editors/code/package.json b/editors/code/package.json index 79df7bdf3e4..4931ad96340 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -369,7 +369,7 @@ }, "$generated-start": {}, "rust-analyzer.assist.expressionFillDefault": { - "markdownDescription": "Placeholder for missing expressions in assists.", + "markdownDescription": "Placeholder expression to use for missing expressions in assists.", "default": "todo", "type": "string", "enum": [ @@ -392,7 +392,7 @@ "type": "boolean" }, "rust-analyzer.cargo.buildScripts.overrideCommand": { - "markdownDescription": "Advanced option, fully override the command rust-analyzer uses to\nrun build scripts and build procedural macros. The command should\ninclude `--message-format=json` or a similar option.", + "markdownDescription": "Override the command rust-analyzer uses to run build scripts and\nbuild procedural macros. The command is required to output json\nand should therefor include `--message-format=json` or a similar\noption.\n\nBy default, a cargo invocation will be constructed for the configured\ntargets and features, with the following base command line:\n\n```bash\ncargo check --quiet --workspace --message-format=json --all-targets\n```\n.", "default": null, "type": [ "null", @@ -408,7 +408,7 @@ "type": "boolean" }, "rust-analyzer.cargo.features": { - "markdownDescription": "List of features to activate. Set to `\"all\"` to pass `--all-features` to cargo.", + "markdownDescription": "List of features to activate.\n\nSet this to `\"all\"` to pass `--all-features` to cargo.", "default": [], "type": [ "string", @@ -425,7 +425,7 @@ ] }, "rust-analyzer.cargo.noDefaultFeatures": { - "markdownDescription": "Do not activate the `default` feature.", + "markdownDescription": "Whether to pass `--no-default-features` to cargo.", "default": false, "type": "boolean" }, @@ -476,7 +476,7 @@ } }, "rust-analyzer.checkOnSave.features": { - "markdownDescription": "List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`. Set to `\"all\"` to pass `--all-features` to cargo.", + "markdownDescription": "List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`.\n\nSet to `\"all\"` to pass `--all-features` to cargo.", "default": null, "type": [ "string", @@ -502,7 +502,7 @@ ] }, "rust-analyzer.checkOnSave.overrideCommand": { - "markdownDescription": "Advanced option, fully override the command rust-analyzer uses for\nchecking. The command should include `--message-format=json` or\nsimilar option.", + "markdownDescription": "Override the command rust-analyzer uses to run build scripts and\nbuild procedural macros. The command is required to output json\nand should therefor include `--message-format=json` or a similar\noption.\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.", "default": null, "type": [ "null", @@ -655,22 +655,22 @@ "type": "string" }, "rust-analyzer.highlightRelated.breakPoints.enable": { - "markdownDescription": "Enables highlighting of related references while hovering your mouse `break`, `loop`, `while`, or `for` keywords.", + "markdownDescription": "Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.", "default": true, "type": "boolean" }, "rust-analyzer.highlightRelated.exitPoints.enable": { - "markdownDescription": "Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`).", + "markdownDescription": "Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).", "default": true, "type": "boolean" }, "rust-analyzer.highlightRelated.references.enable": { - "markdownDescription": "Enables highlighting of related references while hovering your mouse above any identifier.", + "markdownDescription": "Enables highlighting of related references while the cursor is on any identifier.", "default": true, "type": "boolean" }, "rust-analyzer.highlightRelated.yieldPoints.enable": { - "markdownDescription": "Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords.", + "markdownDescription": "Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords.", "default": true, "type": "boolean" }, @@ -824,7 +824,7 @@ "type": "boolean" }, "rust-analyzer.inlayHints.typeHints.hideNamedConstructor": { - "markdownDescription": "Whether to hide inlay hints for constructors.", + "markdownDescription": "Whether to hide inlay type hints for constructors.", "default": false, "type": "boolean" }, @@ -936,7 +936,7 @@ "type": "boolean" }, "rust-analyzer.procMacro.enable": { - "markdownDescription": "Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.", + "markdownDescription": "Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`.", "default": true, "type": "boolean" }, -- cgit 1.4.1-3-g733a5