Conversation
src/vs/vscode.proposed.d.ts
Outdated
There was a problem hiding this comment.
using these field names make DefinitionLink compatible with Location
There was a problem hiding this comment.
sneaky... we could also make origin mandatory and use the position of the request as origin
There was a problem hiding this comment.
or did you plan that as non-breaking API evolution?
There was a problem hiding this comment.
Main reason for making it optional is that I think it makes sense for implementers:
- When
originis provided: always use this value. - When
originis undefined: use the word range at the request position as theorigin
If origin is not optional, I believe many extensions would have to compute the word range themselves
|
@mjbvz Please fix merge conflicts |
| }); | ||
| } | ||
|
|
||
| private static convertDefinitionLink(position: IPosition, value: vscode.Location | vscode.DefinitionLink): modes.DefinitionLink { |
There was a problem hiding this comment.
position is unused. move to extHostTypeConverter?
| origin?: Range; | ||
| uri: Uri; | ||
| range: Range; | ||
| selectionRange?: Range; |
There was a problem hiding this comment.
One a second thought I wonder if defaulting DefinitionLink.range to Location.range is the right thing... It feels more like the selectionRange cos that's how it is currently used. It's also OK to leave this out of this PR but something we should likely do when we optimise how the preview hover is computed.
| let wordRange: Range; | ||
| if (result.origin) { | ||
| const range = result.origin; | ||
| wordRange = new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); |
Add a new `DefinitionLink` type. This type allows definition providers to return additional metadata about a definition, such as the defining span. Hook up this new provider for typescript This PR replaces microsoft#48001
- Use lift - Remove unused param
|
@jrieken Thanks. I've made the suggested changes and will merge this into proposed I may be confusing |
|
Yeah, |
Add a new
DefinitionLinktype. This type allows definition providers to return additional metadata about a definition, such as the defining span.Hook up this new provider for typescript
This PR replaces #48001
Fixes #10037