fix(53424): in code documentation is not working upon import if function expression reuse function type (#53964)

This commit is contained in:
Oleksandr T
2023-05-09 02:55:04 +03:00
committed by GitHub
parent 6947c98929
commit 320e628a6d
3 changed files with 108 additions and 3 deletions

View File

@@ -535,12 +535,12 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
// don't use symbolFlags since getAliasedSymbol requires the flag on the symbol itself
if (symbol.flags & SymbolFlags.Alias) {
prefixNextMeaning();
if (!hasAddedSymbolInfo) {
if (!hasAddedSymbolInfo || documentation.length === 0 && tags.length === 0) {
const resolvedSymbol = typeChecker.getAliasedSymbol(symbol);
if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) {
const resolvedNode = resolvedSymbol.declarations[0];
const declarationName = getNameOfDeclaration(resolvedNode);
if (declarationName) {
if (declarationName && !hasAddedSymbolInfo) {
const isExternalModuleDeclaration =
isModuleWithStringLiteralName(resolvedNode) &&
hasSyntacticModifier(resolvedNode, ModifierFlags.Ambient);
@@ -835,7 +835,6 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
documentation = allSignatures[0].getDocumentationComment(typeChecker);
tags = allSignatures[0].getJsDocTags().filter(tag => tag.name !== "deprecated"); // should only include @deprecated JSDoc tag on the first overload (#49368)
}
}
function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node | undefined) {