Skip to content

Commit

Permalink
add LocationLink use it in Declaration-type, make DefinitionLink an a…
Browse files Browse the repository at this point in the history
…lias, #62483
  • Loading branch information
jrieken committed Nov 14, 2018
1 parent 8a50fca commit c9408a6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
58 changes: 30 additions & 28 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2208,34 +2208,7 @@ declare module 'vscode' {
* Provides additional metadata over normal [location](#Location) definitions, including the range of
* the defining symbol
*/
export interface DefinitionLink {
/**
* Span of the symbol being defined in the source file.
*
* Used as the underlined span for mouse definition hover. Defaults to the word range at
* the definition position.
*/
originSelectionRange?: Range;

/**
* The resource identifier of the definition.
*/
targetUri: Uri;

/**
* The full range of the definition.
*
* For a class definition for example, this would be the entire body of the class definition.
*/
targetRange: Range;

/**
* The span of the symbol definition.
*
* For a class definition, this would be the class name itself in the class definition.
*/
targetSelectionRange?: Range;
}
export type DefinitionLink = LocationLink;

/**
* The definition of a symbol represented as one or many [locations](#Location).
Expand Down Expand Up @@ -3993,6 +3966,35 @@ declare module 'vscode' {
constructor(uri: Uri, rangeOrPosition: Range | Position);
}

/**
* Represents the connection of two locations. Provides additional metadata over normal [locations](#Location),
* including an origin range.
*/
export interface LocationLink {
/**
* Span of the origin of this link.
*
* Used as the underlined span for mouse definition hover. Defaults to the word range at
* the definition position.
*/
originSelectionRange?: Range;

/**
* The target resource identifier of this link.
*/
targetUri: Uri;

/**
* The full target range of this link.
*/
targetRange: Range;

/**
* The span of this link.
*/
targetSelectionRange?: Range;
}

/**
* The event that is fired when diagnostics change.
*/
Expand Down
5 changes: 3 additions & 2 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ declare module 'vscode' {
//#region Joh

/**
*
* The declaration of a symbol representation as one or many [locations](#Location)
* or [location links][#LocationLink].
*/
export type Declaration = Location | Location[] | DefinitionLink[];
export type Declaration = Location | Location[] | LocationLink[];

/**
* The declaration provider interface defines the contract between extensions and
Expand Down

0 comments on commit c9408a6

Please sign in to comment.