Handle undefined location.parent when getting completionEntryDetails (#54138)

This commit is contained in:
Maria José Solano authored and GitHub committed 2023-05-05 13:41:50 -07:00
1 parent 910efac23e
commit 42d69cfa77
3 files changed
+3588 -1

No files matched your search

+1 -1
View File
@@ -452,7 +452,7 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
displayParts.push(spacePart());
addRange(displayParts, typeToDisplayParts(typeChecker, isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
addRange(displayParts, typeToDisplayParts(typeChecker, location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
}
if (symbolFlags & SymbolFlags.Enum) {
prefixNextMeaning();
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,7 @@
/// <reference path="fourslash.ts" />
//// /**/
//// type foo = any;
//// declare const foo: any;
verify.baselineCompletions();