diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-12-18 00:57:38 +0200 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-12-20 11:30:19 +0200 |
| commit | b80bb583e43181bc4a4470a2c19481583edab10b (patch) | |
| tree | 3390e7f7247051f32c99b62c1842bcb623afbe57 /src/tools/rust-analyzer/editors/code/package.json | |
| parent | 5c6bae0fc0930d57dba2e279c0b67a4397b3999c (diff) | |
| download | rust-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/editors/code/package.json')
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/package.json | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/editors/code/package.json b/src/tools/rust-analyzer/editors/code/package.json index 469c1b458d5..b1daaff27a2 100644 --- a/src/tools/rust-analyzer/editors/code/package.json +++ b/src/tools/rust-analyzer/editors/code/package.json @@ -1533,6 +1533,29 @@ { "title": "hover", "properties": { + "rust-analyzer.hover.maxSubstitutionLength": { + "markdownDescription": "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.\n\nThis 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.\n\nThe default is 20 characters.", + "default": 20, + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "enum": [ + "hide" + ] + }, + { + "type": "integer" + } + ] + } + } + }, + { + "title": "hover", + "properties": { "rust-analyzer.hover.memoryLayout.alignment": { "markdownDescription": "How to render the align information in a memory layout hover.", "default": "hexadecimal", |
