-
Notifications
You must be signed in to change notification settings - Fork 4
Allow to query workspace/symbols by a SymbolDescriptor #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -117,3 +117,26 @@ interface SymbolLocationInformation { | |||||||||
} | ||||||||||
``` | ||||||||||
* error: code and message set in case an exception happens during the definition request. | ||||||||||
|
||||||||||
|
||||||||||
### Extended Workspace Symbol Request | ||||||||||
|
||||||||||
The `workspace/symbol` request takes an optional parameter `symbol` that allows you to query by known properties about the symbol. | ||||||||||
The string `query` parameter becomes optional. | ||||||||||
|
||||||||||
```typescript | ||||||||||
/** | ||||||||||
* The parameters of a Workspace Symbol Request. | ||||||||||
*/ | ||||||||||
interface WorkspaceSymbolParams { | ||||||||||
/** | ||||||||||
* A query string | ||||||||||
*/ | ||||||||||
query?: string; | ||||||||||
|
||||||||||
/** | ||||||||||
* Known properties about the symbol. | ||||||||||
*/ | ||||||||||
symbol?: Partial<SymbolDescriptor>; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we must modify the type of i.e. why not just have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about that too, but there are languages that are strictly typed and cannot have it either be a string or an object. LSP will avoid these union types in the future, see microsoft#39. There isn't really a disadvantage to it, but it increases the likelihood of the proposal getting accepted later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, and sounds good. In that case:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||
} | ||||||||||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixfbecker think it might be good to give examples of the different use cases of
query
andsymbol
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add an examples section.