mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
Add isDefinition to ReferenceEntry
Clients can now easily tell if the reference is to a definition or a usage.
This commit is contained in:
@@ -1208,6 +1208,7 @@ namespace ts {
|
||||
textSpan: TextSpan;
|
||||
fileName: string;
|
||||
isWriteAccess: boolean;
|
||||
isDefinition?: boolean;
|
||||
}
|
||||
|
||||
export interface DocumentHighlights {
|
||||
@@ -6183,7 +6184,8 @@ namespace ts {
|
||||
references: [{
|
||||
fileName: sourceFile.fileName,
|
||||
textSpan: createTextSpan(position, searchText.length),
|
||||
isWriteAccess: false
|
||||
isWriteAccess: false,
|
||||
isDefinition: false
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -6737,7 +6739,8 @@ namespace ts {
|
||||
return {
|
||||
fileName: node.getSourceFile().fileName,
|
||||
textSpan: createTextSpanFromBounds(start, end),
|
||||
isWriteAccess: isWriteAccess(node)
|
||||
isWriteAccess: isWriteAccess(node),
|
||||
isDefinition: isDeclarationName(node)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace ts {
|
||||
|
||||
/**
|
||||
* Returns a JSON-encoded value of the type:
|
||||
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
|
||||
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean, isDefinition?: boolean }[]
|
||||
*/
|
||||
getReferencesAtPosition(fileName: string, position: number): string;
|
||||
|
||||
@@ -1141,4 +1141,4 @@ namespace TypeScript.Services {
|
||||
/* @internal */
|
||||
const toolsVersion = "1.9";
|
||||
|
||||
/* tslint:enable:no-unused-variable */
|
||||
/* tslint:enable:no-unused-variable */
|
||||
|
||||
Reference in New Issue
Block a user