about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/docs
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2024-12-18 00:57:38 +0200
committerChayim Refael Friedman <chayimfr@gmail.com>2024-12-20 11:30:19 +0200
commitb80bb583e43181bc4a4470a2c19481583edab10b (patch)
tree3390e7f7247051f32c99b62c1842bcb623afbe57 /src/tools/rust-analyzer/docs
parent5c6bae0fc0930d57dba2e279c0b67a4397b3999c (diff)
downloadrust-b80bb583e43181bc4a4470a2c19481583edab10b.tar.gz
rust-b80bb583e43181bc4a4470a2c19481583edab10b.zip
Show substitution where hovering over generic things
There are few things to note in the implementation:

First, this is a best-effort implementation. Mainly, type aliases may not be shown (due to their eager nature it's harder) and partial pathes (aka. hovering over `Struct` in `Struct::method`) are not supported at all.

Second, we only need to show substitutions in expression and pattern position, because in type position all generic arguments always have to be written explicitly.
Diffstat (limited to 'src/tools/rust-analyzer/docs')
-rw-r--r--src/tools/rust-analyzer/docs/user/generated_config.adoc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/docs/user/generated_config.adoc b/src/tools/rust-analyzer/docs/user/generated_config.adoc
index 1195a85cf70..ce3d0e3d803 100644
--- a/src/tools/rust-analyzer/docs/user/generated_config.adoc
+++ b/src/tools/rust-analyzer/docs/user/generated_config.adoc
@@ -512,6 +512,15 @@ Whether to show keyword hover popups. Only applies when
 --
 Use markdown syntax for links on hover.
 --
+[[rust-analyzer.hover.maxSubstitutionLength]]rust-analyzer.hover.maxSubstitutionLength (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.
+
+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.
+--
 [[rust-analyzer.hover.memoryLayout.alignment]]rust-analyzer.hover.memoryLayout.alignment (default: `"hexadecimal"`)::
 +
 --