Skip to content

Commit

Permalink
Add possible values in the doc + json package
Browse files Browse the repository at this point in the history
  • Loading branch information
PtiBouchon committed Feb 26, 2024
1 parent 12e7aa3 commit 9ea6564
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 18 deletions.
18 changes: 18 additions & 0 deletions crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ config_data! {
/// Check all targets and tests (`--all-targets`).
check_allTargets | checkOnSave_allTargets: bool = "true",
/// Cargo command to use for `cargo check`.
/// Common alternative is `"clippy"`.
check_command | checkOnSave_command: String = "\"check\"",
/// Extra arguments for `cargo check`.
check_extraArgs | checkOnSave_extraArgs: Vec<String> = "[]",
Expand Down Expand Up @@ -223,6 +224,7 @@ config_data! {
/// with `self` prefixed to them when inside a method.
completion_autoself_enable: bool = "true",
/// Whether to add parenthesis and argument snippets when completing function.
/// Possible values are: `"fill_arguments"`, `"add_parentheses"`, `"none"`.
completion_callable_snippets: CallableCompletionDef = "\"fill_arguments\"",
/// Whether to show full function/method signatures in completion docs.
completion_fullFunctionSignatures_enable: bool = "false",
Expand Down Expand Up @@ -301,6 +303,7 @@ config_data! {
/// also need to add the folders to Code's `files.watcherExclude`.
files_excludeDirs: Vec<PathBuf> = "[]",
/// Controls file watching implementation.
/// Possible values are: `"client"`, `"notify"`, `"server"`.
files_watcher: FilesWatcherDef = "\"client\"",

/// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
Expand Down Expand Up @@ -340,19 +343,23 @@ config_data! {
/// Use markdown syntax for links on hover.
hover_links_enable: bool = "true",
/// How to render the align information in a memory layout hover.
/// Possible values are: `"hexadecimal"`, `"decimal"`, `"both"`.
hover_memoryLayout_alignment: Option<MemoryLayoutHoverRenderKindDef> = "\"hexadecimal\"",
/// Whether to show memory layout data on hover.
hover_memoryLayout_enable: bool = "true",
/// How to render the niche information in a memory layout hover.
hover_memoryLayout_niches: Option<bool> = "false",
/// How to render the offset information in a memory layout hover.
/// Possible values are: `"hexadecimal"`, `"decimal"`, `"both"`.
hover_memoryLayout_offset: Option<MemoryLayoutHoverRenderKindDef> = "\"hexadecimal\"",
/// How to render the size information in a memory layout hover.
/// Possible values are: `"hexadecimal"`, `"decimal"`, `"both"`.
hover_memoryLayout_size: Option<MemoryLayoutHoverRenderKindDef> = "\"both\"",

/// 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_granularity_enforce: bool = "false",
/// How imports should be grouped into use statements.
/// Possible values are: `"preserve"`, `"item"`, `"crate"`, `"module"`.
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_enable: bool = "true",
Expand All @@ -363,6 +370,7 @@ config_data! {
/// Whether to prefer import paths containing a `prelude` module.
imports_preferPrelude: bool = "false",
/// The path structure for newly inserted paths to use.
/// Possible values are: `"plain"`, `"by_self"`, `"by_crate"`.
imports_prefix: ImportPrefixDef = "\"plain\"",

/// Whether to show inlay type hints for binding modes.
Expand All @@ -377,20 +385,26 @@ config_data! {
/// Whether to show inlay hints for closure captures.
inlayHints_closureCaptureHints_enable: bool = "false",
/// Whether to show inlay type hints for return types of closures.
/// Possible values are: `"always"`, `"never"`, `"with_block"`.
inlayHints_closureReturnTypeHints_enable: ClosureReturnTypeHintsDef = "\"never\"",
/// Closure notation in type and chaining inlay hints.
/// Possible values are: `"impl_fn"`, `"rust_analyzer"`, `"with_id"`, `"hide"`.
inlayHints_closureStyle: ClosureStyle = "\"impl_fn\"",
/// Whether to show enum variant discriminant hints.
/// Possible values are: `"always"`, `"never"`, `"fieldless"`.
inlayHints_discriminantHints_enable: DiscriminantHintsDef = "\"never\"",
/// Whether to show inlay hints for type adjustments.
/// Possible values are: `"always"`, `"never"`, `"reborrow"`.
inlayHints_expressionAdjustmentHints_enable: AdjustmentHintsDef = "\"never\"",
/// Whether to hide inlay hints for type adjustments outside of `unsafe` blocks.
inlayHints_expressionAdjustmentHints_hideOutsideUnsafe: bool = "false",
/// Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc).
/// Possible values are: `"prefix"`, `"postfix"`, `"prefer_prefix"`, `"prefer_postfix"`.
inlayHints_expressionAdjustmentHints_mode: AdjustmentHintsModeDef = "\"prefix\"",
/// Whether to show implicit drop hints.
inlayHints_implicitDrops_enable: bool = "false",
/// Whether to show inlay type hints for elided lifetimes in function signatures.
/// Possible values are: `"always"`, `"never"`, `"skip_trivial"`.
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",
Expand Down Expand Up @@ -438,6 +452,7 @@ config_data! {
/// `#rust-analyzer.lens.enable#` is set.
lens_implementations_enable: bool = "true",
/// Where to render annotations.
/// Possible values are: `"above_name"`, `"above_whole_item"`.
lens_location: AnnotationLocation = "\"above_name\"",
/// Whether to show `References` lens for Struct, Enum, and Union.
/// Only applies when `#rust-analyzer.lens.enable#` is set.
Expand Down Expand Up @@ -562,6 +577,7 @@ config_data! {
semanticHighlighting_strings_enable: bool = "true",

/// Show full signature of the callable. Only shows parameters if disabled.
/// Possible values are: `"full"`, `"parameters"`.
signatureInfo_detail: SignatureDetail = "\"full\"",
/// Show documentation.
signatureInfo_documentation_enable: bool = "true",
Expand All @@ -570,12 +586,14 @@ config_data! {
typing_autoClosingAngleBrackets_enable: bool = "false",

/// Workspace symbol search kind.
/// Possible values are: `"only_types"`, `"all_symbols"`.
workspace_symbol_search_kind: WorkspaceSymbolSearchKindDef = "\"only_types\"",
/// Limits the number of items returned from a workspace symbol search (Defaults to 128).
/// 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.
workspace_symbol_search_limit: usize = "128",
/// Workspace symbol search scope.
/// Possible values are: `"workspace"`, `"workspace_and_dependencies"`.
workspace_symbol_search_scope: WorkspaceSymbolSearchScopeDef = "\"workspace\"",
}
}
Expand Down
18 changes: 18 additions & 0 deletions docs/user/generated_config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Check all targets and tests (`--all-targets`).
+
--
Cargo command to use for `cargo check`.
Common alternative is `"clippy"`.
--
[[rust-analyzer.check.extraArgs]]rust-analyzer.check.extraArgs (default: `[]`)::
+
Expand Down Expand Up @@ -257,6 +258,7 @@ with `self` prefixed to them when inside a method.
+
--
Whether to add parenthesis and argument snippets when completing function.
Possible values are: `"fill_arguments"`, `"add_parentheses"`, `"none"`.
--
[[rust-analyzer.completion.fullFunctionSignatures.enable]]rust-analyzer.completion.fullFunctionSignatures.enable (default: `false`)::
+
Expand Down Expand Up @@ -377,6 +379,7 @@ also need to add the folders to Code's `files.watcherExclude`.
+
--
Controls file watching implementation.
Possible values are: `"client"`, `"notify"`, `"server"`.
--
[[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`)::
+
Expand Down Expand Up @@ -458,6 +461,7 @@ Use markdown syntax for links on hover.
+
--
How to render the align information in a memory layout hover.
Possible values are: `"hexadecimal"`, `"decimal"`, `"both"`.
--
[[rust-analyzer.hover.memoryLayout.enable]]rust-analyzer.hover.memoryLayout.enable (default: `true`)::
+
Expand All @@ -473,11 +477,13 @@ How to render the niche information in a memory layout hover.
+
--
How to render the offset information in a memory layout hover.
Possible values are: `"hexadecimal"`, `"decimal"`, `"both"`.
--
[[rust-analyzer.hover.memoryLayout.size]]rust-analyzer.hover.memoryLayout.size (default: `"both"`)::
+
--
How to render the size information in a memory layout hover.
Possible values are: `"hexadecimal"`, `"decimal"`, `"both"`.
--
[[rust-analyzer.imports.granularity.enforce]]rust-analyzer.imports.granularity.enforce (default: `false`)::
+
Expand All @@ -488,6 +494,7 @@ Whether to enforce the import granularity setting for all files. If set to false
+
--
How imports should be grouped into use statements.
Possible values are: `"preserve"`, `"item"`, `"crate"`, `"module"`.
--
[[rust-analyzer.imports.group.enable]]rust-analyzer.imports.group.enable (default: `true`)::
+
Expand All @@ -513,6 +520,7 @@ Whether to prefer import paths containing a `prelude` module.
+
--
The path structure for newly inserted paths to use.
Possible values are: `"plain"`, `"by_self"`, `"by_crate"`.
--
[[rust-analyzer.inlayHints.bindingModeHints.enable]]rust-analyzer.inlayHints.bindingModeHints.enable (default: `false`)::
+
Expand Down Expand Up @@ -544,21 +552,25 @@ Whether to show inlay hints for closure captures.
+
--
Whether to show inlay type hints for return types of closures.
Possible values are: `"always"`, `"never"`, `"with_block"`.
--
[[rust-analyzer.inlayHints.closureStyle]]rust-analyzer.inlayHints.closureStyle (default: `"impl_fn"`)::
+
--
Closure notation in type and chaining inlay hints.
Possible values are: `"impl_fn"`, `"rust_analyzer"`, `"with_id"`, `"hide"`.
--
[[rust-analyzer.inlayHints.discriminantHints.enable]]rust-analyzer.inlayHints.discriminantHints.enable (default: `"never"`)::
+
--
Whether to show enum variant discriminant hints.
Possible values are: `"always"`, `"never"`, `"fieldless"`.
--
[[rust-analyzer.inlayHints.expressionAdjustmentHints.enable]]rust-analyzer.inlayHints.expressionAdjustmentHints.enable (default: `"never"`)::
+
--
Whether to show inlay hints for type adjustments.
Possible values are: `"always"`, `"never"`, `"reborrow"`.
--
[[rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe]]rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe (default: `false`)::
+
Expand All @@ -569,6 +581,7 @@ Whether to hide inlay hints for type adjustments outside of `unsafe` blocks.
+
--
Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc).
Possible values are: `"prefix"`, `"postfix"`, `"prefer_prefix"`, `"prefer_postfix"`.
--
[[rust-analyzer.inlayHints.implicitDrops.enable]]rust-analyzer.inlayHints.implicitDrops.enable (default: `false`)::
+
Expand All @@ -579,6 +592,7 @@ Whether to show implicit drop hints.
+
--
Whether to show inlay type hints for elided lifetimes in function signatures.
Possible values are: `"always"`, `"never"`, `"skip_trivial"`.
--
[[rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames]]rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames (default: `false`)::
+
Expand Down Expand Up @@ -680,6 +694,7 @@ Whether to show `Implementations` lens. Only applies when
+
--
Where to render annotations.
Possible values are: `"above_name"`, `"above_whole_item"`.
--
[[rust-analyzer.lens.references.adt.enable]]rust-analyzer.lens.references.adt.enable (default: `false`)::
+
Expand Down Expand Up @@ -885,6 +900,7 @@ their contents.
+
--
Show full signature of the callable. Only shows parameters if disabled.
Possible values are: `"full"`, `"parameters"`.
--
[[rust-analyzer.signatureInfo.documentation.enable]]rust-analyzer.signatureInfo.documentation.enable (default: `true`)::
+
Expand All @@ -900,6 +916,7 @@ Whether to insert closing angle brackets when typing an opening angle bracket of
+
--
Workspace symbol search kind.
Possible values are: `"only_types"`, `"all_symbols"`.
--
[[rust-analyzer.workspace.symbol.search.limit]]rust-analyzer.workspace.symbol.search.limit (default: `128`)::
+
Expand All @@ -912,4 +929,5 @@ Other clients requires all results upfront and might require a higher limit.
+
--
Workspace symbol search scope.
Possible values are: `"workspace"`, `"workspace_and_dependencies"`.
--
Loading

0 comments on commit 9ea6564

Please sign in to comment.