mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Fixed a crash when getting document highlights on out variance annotation (#56408)
This commit is contained in:
committed by
GitHub
parent
e170bc59d4
commit
d1d14e67d0
@@ -178,6 +178,7 @@ export namespace DocumentHighlights {
|
||||
case SyntaxKind.YieldKeyword:
|
||||
return highlightSpans(getYieldOccurrences(node));
|
||||
case SyntaxKind.InKeyword:
|
||||
case SyntaxKind.OutKeyword:
|
||||
return undefined;
|
||||
default:
|
||||
return isModifierKind(node.kind) && (isDeclaration(node.parent) || isVariableStatement(node.parent))
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// === documentHighlights ===
|
||||
// === /tests/cases/fourslash/documentHighlightVarianceModifiers.ts ===
|
||||
// type TFoo<Value> = { value: Value };
|
||||
// type TBar</*HIGHLIGHTS*/in out Value> = TFoo<Value>;
|
||||
|
||||
|
||||
|
||||
// === documentHighlights ===
|
||||
// === /tests/cases/fourslash/documentHighlightVarianceModifiers.ts ===
|
||||
// type TFoo<Value> = { value: Value };
|
||||
// type TBar<in /*HIGHLIGHTS*/out Value> = TFoo<Value>;
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// type TFoo<Value> = { value: Value };
|
||||
//// type TBar<[|in|] [|out|] Value> = TFoo<Value>;
|
||||
|
||||
verify.baselineDocumentHighlights();
|
||||
Reference in New Issue
Block a user