Skip to content

Commit 7c8da42

Browse files
committed
Merge pull request microsoft#4279 from Microsoft/highlightRefsInOneDocument
keep only document highlights from the original file
2 parents 9717427 + ce44d95 commit 7c8da42

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/services/shims.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,10 @@ namespace ts {
752752
return this.forwardJSONCall(
753753
"getDocumentHighlights('" + fileName + "', " + position + ")",
754754
() => {
755-
return this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
755+
var results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
756+
// workaround for VS document higlighting issue - keep only items from the initial file
757+
let normalizedName = normalizeSlashes(fileName).toLowerCase();
758+
return filter(results, r => normalizeSlashes(r.fileName).toLowerCase() === normalizedName);
756759
});
757760
}
758761

0 commit comments

Comments
 (0)