Skip to content

Commit 42d69cf

Browse files
authored
Handle undefined location.parent when getting completionEntryDetails (microsoft#54138)
1 parent 910efac commit 42d69cf

File tree

3 files changed

+3588
-1
lines changed

3 files changed

+3588
-1
lines changed

src/services/symbolDisplay.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
452452
displayParts.push(spacePart());
453453
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
454454
displayParts.push(spacePart());
455-
addRange(displayParts, typeToDisplayParts(typeChecker, isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
455+
addRange(displayParts, typeToDisplayParts(typeChecker, location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
456456
}
457457
if (symbolFlags & SymbolFlags.Enum) {
458458
prefixNextMeaning();

0 commit comments

Comments
 (0)