Skip to content

Commit 2a4279b

Browse files
authored
Allow to query workspace/symbols by a SymbolDescriptor (#12)
1 parent f798195 commit 2a4279b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

extension-workspace-references.md

+39
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ interface ServerCapabilities {
2121
* The server provides extended text document definition support.
2222
*/
2323
xdefinitionProvider?: boolean;
24+
25+
/**
26+
* The server provides support for querying symbols by properties
27+
* with WorkspaceSymbolParams.symbol
28+
*/
29+
xworkspaceSymbolByProperties?: boolean;
2430
}
2531
```
2632

@@ -117,3 +123,36 @@ interface SymbolLocationInformation {
117123
}
118124
```
119125
* error: code and message set in case an exception happens during the definition request.
126+
127+
128+
### Extended Workspace Symbol Request
129+
130+
The `workspace/symbol` request takes an optional parameter `symbol` that allows you to query by known properties about the symbol.
131+
The string `query` parameter becomes optional.
132+
If both `query` and `symbol` are provided, both should both be matched with AND semantics.
133+
134+
#### Differences between `symbol` and `query`
135+
136+
`query` | `symbol`
137+
-------------------------------------|------------------------------------
138+
comes from user input in UI | used programmatically
139+
matches as fuzzily as possible | matches as exact as possible
140+
returns as many results as possible | returns as few results as possible
141+
142+
143+
```typescript
144+
/**
145+
* The parameters of a Workspace Symbol Request.
146+
*/
147+
interface WorkspaceSymbolParams {
148+
/**
149+
* A query string
150+
*/
151+
query?: string;
152+
153+
/**
154+
* Known properties about the symbol.
155+
*/
156+
symbol?: Partial<SymbolDescriptor>;
157+
}
158+
```

0 commit comments

Comments
 (0)