mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Fixed crash on ComputedPropertyName when computing interactive inlay hints (#61857)
This commit is contained in:
committed by
GitHub
parent
36f7fbaded
commit
8665f920c9
@@ -42,6 +42,7 @@ import {
|
||||
isBindingPattern,
|
||||
isCallExpression,
|
||||
isCallSignatureDeclaration,
|
||||
isComputedPropertyName,
|
||||
isConditionalTypeNode,
|
||||
isConstructorTypeNode,
|
||||
isConstructSignatureDeclaration,
|
||||
@@ -886,6 +887,12 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
|
||||
Debug.assertNode(node, isThisTypeNode);
|
||||
parts.push({ text: "this" });
|
||||
break;
|
||||
case SyntaxKind.ComputedPropertyName:
|
||||
Debug.assertNode(node, isComputedPropertyName);
|
||||
parts.push({ text: "[" });
|
||||
visitForDisplayParts(node.expression);
|
||||
parts.push({ text: "]" });
|
||||
break;
|
||||
default:
|
||||
Debug.failBadSyntaxKind(node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user