mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
support JSDoc comments inherited for parameter properties (#44329)
* support JSDoc comments inherited for parameter properties * Update formats Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
@@ -591,7 +591,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
function findBaseOfDeclaration<T>(checker: TypeChecker, declaration: Declaration, cb: (symbol: Symbol) => T[] | undefined): T[] | undefined {
|
||||
return firstDefined(declaration.parent ? getAllSuperTypeNodes(declaration.parent) : emptyArray, superTypeNode => {
|
||||
const classOrInterfaceDeclaration = declaration.parent?.kind === SyntaxKind.Constructor ? declaration.parent.parent : declaration.parent;
|
||||
if (!classOrInterfaceDeclaration) {
|
||||
return;
|
||||
}
|
||||
return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), superTypeNode => {
|
||||
const symbol = checker.getPropertyOfType(checker.getTypeAtLocation(superTypeNode), declaration.symbol.name);
|
||||
return symbol ? cb(symbol) : undefined;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user