mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Handle undefined location.parent when getting completionEntryDetails (#54138)
This commit is contained in:
parent
910efac23e
commit
42d69cfa77
@ -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();
|
||||
|
||||
3580
tests/baselines/reference/completionNoParentLocation.baseline
Normal file
3580
tests/baselines/reference/completionNoParentLocation.baseline
Normal file
File diff suppressed because it is too large
Load Diff
7
tests/cases/fourslash/completionNoParentLocation.ts
Normal file
7
tests/cases/fourslash/completionNoParentLocation.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// /**/
|
||||
//// type foo = any;
|
||||
//// declare const foo: any;
|
||||
|
||||
verify.baselineCompletions();
|
||||
Loading…
x
Reference in New Issue
Block a user