diff options
author | alcroito <[email protected]> | 2021-02-23 12:03:31 +0000 |
---|---|---|
committer | alcroito <[email protected]> | 2021-05-17 23:40:30 +0100 |
commit | 1f7d2a6c2297de4dedfb42b739e880ad2dd7d5d5 (patch) | |
tree | 46f7897cceaac302c0930dcdae99593e795b1351 /editors | |
parent | c04eaa1f37f31d7125372ba14da3d5059297e8b2 (diff) |
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.
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/package.json | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index 2e67b6775..99223c4e8 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -783,6 +783,32 @@ | |||
783 | "type": "string" | 783 | "type": "string" |
784 | } | 784 | } |
785 | }, | 785 | }, |
786 | "rust-analyzer.workspace.symbol.search.scope": { | ||
787 | "markdownDescription": "Workspace symbol search scope.", | ||
788 | "default": "workspace", | ||
789 | "type": "string", | ||
790 | "enum": [ | ||
791 | "workspace", | ||
792 | "workspace_and_dependencies" | ||
793 | ], | ||
794 | "enumDescriptions": [ | ||
795 | "Search in current workspace only", | ||
796 | "Search in current workspace and dependencies" | ||
797 | ] | ||
798 | }, | ||
799 | "rust-analyzer.workspace.symbol.search.kind": { | ||
800 | "markdownDescription": "Workspace symbol search kind.", | ||
801 | "default": "only_types", | ||
802 | "type": "string", | ||
803 | "enum": [ | ||
804 | "only_types", | ||
805 | "all_symbols" | ||
806 | ], | ||
807 | "enumDescriptions": [ | ||
808 | "Search for types only", | ||
809 | "Search for all symbols kinds" | ||
810 | ] | ||
811 | }, | ||
786 | "$generated-end": false | 812 | "$generated-end": false |
787 | } | 813 | } |
788 | }, | 814 | }, |