mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-25 21:37:39 +00:00
Add new LSP extension for workspace symbol lookup
The new extension allows filtering of workspace symbool lookup results by search scope or search kind. Filtering can be configured in 3 different ways: - The '#' or '*' markers can be added inline with the symbol lookup query. The '#' marker means symbols should be looked up in the current workspace and any dependencies. If not specified, only current workspace is considered. The '*' marker means all kinds of symbols should be looked up (types, functions, etc). If not specified, only type symbols are returned. - Each LSP request can take an optional search_scope or search_kind argument query parameter. - Finally there are 2 global config options that can be set for all requests served by the active RA instance. Add support for setting the global config options to the VSCode extension. The extension does not use the per-request way, but it's useful for other IDEs. The latest version of VSCode filters out the inline markers, so currently the only reasonable way to use the new functionality is via the global config.
This commit is contained in:
parent
c04eaa1f37
commit
1f7d2a6c22
8 changed files with 220 additions and 8 deletions
|
|
@ -783,6 +783,32 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"rust-analyzer.workspace.symbol.search.scope": {
|
||||
"markdownDescription": "Workspace symbol search scope.",
|
||||
"default": "workspace",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"workspace",
|
||||
"workspace_and_dependencies"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"Search in current workspace only",
|
||||
"Search in current workspace and dependencies"
|
||||
]
|
||||
},
|
||||
"rust-analyzer.workspace.symbol.search.kind": {
|
||||
"markdownDescription": "Workspace symbol search kind.",
|
||||
"default": "only_types",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"only_types",
|
||||
"all_symbols"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"Search for types only",
|
||||
"Search for all symbols kinds"
|
||||
]
|
||||
},
|
||||
"$generated-end": false
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue