fix(46998): Hover on as const shows type const = /*unresolved*/ any (#47000)

This commit is contained in:
Oleksandr T
2021-12-07 00:41:46 +02:00
committed by GitHub
parent 1fe9bfdd0e
commit 4761ba6285
3 changed files with 267 additions and 1 deletions

View File

@@ -330,7 +330,7 @@ namespace ts.SymbolDisplay {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
displayParts.push(spacePart());
addRange(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
addRange(displayParts, typeToDisplayParts(typeChecker, isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
}
if (symbolFlags & SymbolFlags.Enum) {
prefixNextMeaning();