Fixed crash on ComputedPropertyName when computing interactive inlay hints (#61857)

This commit is contained in:
Mateusz Burzyński
2025-06-30 19:28:27 +02:00
committed by GitHub
parent 36f7fbaded
commit 8665f920c9
3 changed files with 69 additions and 0 deletions

View File

@@ -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);
}