aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-05-19 11:28:58 +0100
committerAleksey Kladov <[email protected]>2021-05-19 11:28:58 +0100
commit1fd31f7f4cf6c65a407cb36b16a86c814c5783c3 (patch)
tree2e98d1f0bdfc4d06f7381de7f87b025cab311d52 /docs
parent49a5d6a8d4a5da296ead4c44ac43090b9b0e8034 (diff)
feat: allow clients to feature detect symbol filtering
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/lsp-extensions.md28
1 files changed, 16 insertions, 12 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 2d3787d0f..3c4eacfeb 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -651,32 +651,36 @@ export const enum Direction {
651} 651}
652``` 652```
653 653
654## Lookup workspace symbol search scope and kind 654## Workspace Symbols Filtering
655 655
656**Issue:** https://github.com/rust-analyzer/rust-analyzer/pull/7698 656**Issue:** https://github.com/rust-analyzer/rust-analyzer/pull/7698
657 657
658This request is sent from client to server to search for workspace symbols filtered by an 658**Experimental Server Capability:** `{ "workspaceSymbolScopeKindFiltering": boolean }`
659optional search scope and / or an optional symbol kind.
660 659
661**Method:** `workspace/symbol` 660Extends the existing `workspace/symbol` request with ability to filter symbols by broad scope and kind of symbol.
661If this capability is set, `workspace/symbol` parameter gains two new optional fields:
662 662
663**Request:** `WorkspaceSymbolParams`
664
665**Response:** `SymbolInformation[] | null`
666 663
667```typescript 664```typescript
668interface lsp_ext.WorkspaceSymbolParams extends WorkspaceSymbolParams { 665interface WorkspaceSymbolParams {
666 /**
667 * Return only the symbols defined in the specified scope.
668 */
669 searchScope?: WorkspaceSymbolSearchScope; 669 searchScope?: WorkspaceSymbolSearchScope;
670 /**
671 * Return only the symbols of specified kinds.
672 */
670 searchKind?: WorkspaceSymbolSearchKind; 673 searchKind?: WorkspaceSymbolSearchKind;
674 ...
671} 675}
672 676
673const enum WorkspaceSymbolSearchScope { 677const enum WorkspaceSymbolSearchScope {
674 Workspace = "Workspace", 678 Workspace = "workspace",
675 WorkspaceAndDependencies = "WorkspaceAndDependencies" 679 WorkspaceAndDependencies = "workspaceAndDependencies"
676} 680}
677 681
678const enum WorkspaceSymbolSearchKind { 682const enum WorkspaceSymbolSearchKind {
679 OnlyTypes = "OnlyTypes", 683 OnlyTypes = "onlyTypes",
680 AllSymbols = "AllSymbols" 684 AllSymbols = "allSymbols"
681} 685}
682``` 686```