Definition link API (#52230)

* Definition link

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 #48001

* Correctly mark field optional

* Small code fixes

- Use lift
- Remove unused param

* Adding documentation
This commit is contained in:
Matt Bierner
2018-06-20 11:52:47 -07:00
committed by GitHub
parent 04c1ad98b3
commit 0532c31e4c
11 changed files with 169 additions and 22 deletions

View File

@@ -752,6 +752,13 @@ export interface LocationDto {
range: IRange;
}
export interface DefinitionLinkDto {
origin?: IRange;
uri: UriComponents;
range: IRange;
selectionRange?: IRange;
}
export interface WorkspaceSymbolDto extends IdObject {
name: string;
containerName?: string;
@@ -808,7 +815,7 @@ export interface ExtHostLanguageFeaturesShape {
$provideDocumentSymbols(handle: number, resource: UriComponents): TPromise<modes.DocumentSymbol[]>;
$provideCodeLenses(handle: number, resource: UriComponents): TPromise<modes.ICodeLensSymbol[]>;
$resolveCodeLens(handle: number, resource: UriComponents, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol>;
$provideDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<LocationDto | LocationDto[]>;
$provideDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<DefinitionLinkDto[]>;
$provideImplementation(handle: number, resource: UriComponents, position: IPosition): TPromise<LocationDto | LocationDto[]>;
$provideTypeDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<LocationDto | LocationDto[]>;
$provideHover(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Hover>;