From e11d2c5ed21572be1501ee3b9d88c0b1b6cb5535 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 26 Apr 2022 22:40:23 +0300 Subject: [PATCH] fix(48851): exclude in from document highlights --- src/services/documentHighlights.ts | 2 ++ tests/cases/fourslash/documentHighlightInKeyword.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/cases/fourslash/documentHighlightInKeyword.ts diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index ffcec349cc663..698f82eda51b4 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -93,6 +93,8 @@ namespace ts { return highlightSpans(getAsyncAndAwaitOccurrences(node)); case SyntaxKind.YieldKeyword: return highlightSpans(getYieldOccurrences(node)); + case SyntaxKind.InKeyword: + return undefined; default: return isModifierKind(node.kind) && (isDeclaration(node.parent) || isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) diff --git a/tests/cases/fourslash/documentHighlightInKeyword.ts b/tests/cases/fourslash/documentHighlightInKeyword.ts new file mode 100644 index 0000000000000..b24d5827ecae3 --- /dev/null +++ b/tests/cases/fourslash/documentHighlightInKeyword.ts @@ -0,0 +1,13 @@ +/// + +////export type Foo = { +//// [K [|in|] keyof T]: any; +////} +//// +////"a" [|in|] {}; +//// +////for (let a [|in|] {}) {} + +for (let range of test.ranges()) { + verify.noDocumentHighlights(range); +}