File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -3641,8 +3641,24 @@ module ts {
36413641 }
36423642 }
36433643
3644- /// References and Occurrences
36453644 function getOccurrencesAtPosition ( fileName : string , position : number ) : ReferenceEntry [ ] {
3645+ let results = getOccurrencesAtPositionCore ( fileName , position ) ;
3646+
3647+ if ( results ) {
3648+ let sourceFile = getCanonicalFileName ( normalizeSlashes ( fileName ) ) ;
3649+
3650+ // ensure the results are in the file we're interested in
3651+ results . forEach ( ( value ) => {
3652+ let targetFile = getCanonicalFileName ( normalizeSlashes ( value . fileName ) ) ;
3653+ Debug . assert ( sourceFile == targetFile , `Unexpected file in results. Found results in ${ targetFile } expected only results in ${ sourceFile } .` ) ;
3654+ } ) ;
3655+ }
3656+
3657+ return results ;
3658+ }
3659+
3660+ /// References and Occurrences
3661+ function getOccurrencesAtPositionCore ( fileName : string , position : number ) : ReferenceEntry [ ] {
36463662 synchronizeHostData ( ) ;
36473663
36483664 let sourceFile = getValidSourceFile ( fileName ) ;
You can’t perform that action at this time.
0 commit comments