File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ namespace ts.server {
376376 fileName : fileName ,
377377 textSpan : ts . createTextSpanFromBounds ( start , end ) ,
378378 isWriteAccess : entry . isWriteAccess ,
379+ isDefinition : entry . isDefinition ,
379380 } ;
380381 } ) ;
381382 }
Original file line number Diff line number Diff line change @@ -304,6 +304,11 @@ declare namespace ts.server.protocol {
304304 * True if reference is a write location, false otherwise.
305305 */
306306 isWriteAccess : boolean ;
307+
308+ /**
309+ * True if reference is a definition, false otherwise.
310+ */
311+ isDefinition ?: boolean ;
307312 }
308313
309314 /**
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ namespace ts.server {
379379 start,
380380 end,
381381 file : fileName ,
382- isWriteAccess
382+ isWriteAccess,
383383 } ;
384384 } ) ;
385385 }
@@ -555,7 +555,8 @@ namespace ts.server {
555555 start : start ,
556556 lineText : lineText ,
557557 end : compilerService . host . positionToLineOffset ( ref . fileName , ts . textSpanEnd ( ref . textSpan ) ) ,
558- isWriteAccess : ref . isWriteAccess
558+ isWriteAccess : ref . isWriteAccess ,
559+ isDefinition : ref . isDefinition
559560 } ;
560561 } ) ;
561562 } ,
Original file line number Diff line number Diff line change @@ -1208,6 +1208,7 @@ namespace ts {
12081208 textSpan : TextSpan ;
12091209 fileName : string ;
12101210 isWriteAccess : boolean ;
1211+ isDefinition ?: boolean ;
12111212 }
12121213
12131214 export interface DocumentHighlights {
@@ -6183,7 +6184,8 @@ namespace ts {
61836184 references : [ {
61846185 fileName : sourceFile . fileName ,
61856186 textSpan : createTextSpan ( position , searchText . length ) ,
6186- isWriteAccess : false
6187+ isWriteAccess : false ,
6188+ isDefinition : false
61876189 } ]
61886190 } ) ;
61896191 }
@@ -6737,7 +6739,8 @@ namespace ts {
67376739 return {
67386740 fileName : node . getSourceFile ( ) . fileName ,
67396741 textSpan : createTextSpanFromBounds ( start , end ) ,
6740- isWriteAccess : isWriteAccess ( node )
6742+ isWriteAccess : isWriteAccess ( node ) ,
6743+ isDefinition : isDeclarationName ( node )
67416744 } ;
67426745 }
67436746
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ namespace ts {
164164
165165 /**
166166 * Returns a JSON-encoded value of the type:
167- * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
167+ * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean, isDefinition?: boolean }[]
168168 */
169169 getReferencesAtPosition ( fileName : string , position : number ) : string ;
170170
@@ -1141,4 +1141,4 @@ namespace TypeScript.Services {
11411141/* @internal */
11421142const toolsVersion = "1.9" ;
11431143
1144- /* tslint:enable:no-unused-variable */
1144+ /* tslint:enable:no-unused-variable */
You can’t perform that action at this time.
0 commit comments