Skip to content

Commit d1d14e6

Browse files
authored
Fixed a crash when getting document highlights on out variance annotation (#56408)
1 parent e170bc5 commit d1d14e6

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/services/documentHighlights.ts

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export namespace DocumentHighlights {
178178
case SyntaxKind.YieldKeyword:
179179
return highlightSpans(getYieldOccurrences(node));
180180
case SyntaxKind.InKeyword:
181+
case SyntaxKind.OutKeyword:
181182
return undefined;
182183
default:
183184
return isModifierKind(node.kind) && (isDeclaration(node.parent) || isVariableStatement(node.parent))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// === documentHighlights ===
2+
// === /tests/cases/fourslash/documentHighlightVarianceModifiers.ts ===
3+
// type TFoo<Value> = { value: Value };
4+
// type TBar</*HIGHLIGHTS*/in out Value> = TFoo<Value>;
5+
6+
7+
8+
// === documentHighlights ===
9+
// === /tests/cases/fourslash/documentHighlightVarianceModifiers.ts ===
10+
// type TFoo<Value> = { value: Value };
11+
// type TBar<in /*HIGHLIGHTS*/out Value> = TFoo<Value>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
//// type TFoo<Value> = { value: Value };
4+
//// type TBar<[|in|] [|out|] Value> = TFoo<Value>;
5+
6+
verify.baselineDocumentHighlights();

0 commit comments

Comments
 (0)