From ce44d9511526c265a3d18b899017642251f1eb85 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 11 Aug 2015 12:04:55 -0700 Subject: [PATCH] keep only document highlights from the original file --- src/services/shims.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/shims.ts b/src/services/shims.ts index 6b679e70b4b..636c983e04c 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -752,7 +752,10 @@ namespace ts { return this.forwardJSONCall( "getDocumentHighlights('" + fileName + "', " + position + ")", () => { - return this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + var results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + // workaround for VS document higlighting issue - keep only items from the initial file + let normalizedName = normalizeSlashes(fileName).toLowerCase(); + return filter(results, r => normalizeSlashes(r.fileName).toLowerCase() === normalizedName); }); }