getEffectiveBaseTypeNode: only use JSDoc augments if there is extends (#29349)

This commit is contained in:
Klaus Meinhardt
2019-02-06 00:51:55 +01:00
committed by Nathan Shively-Sanders
parent 7c096576bc
commit 12edac0925
4 changed files with 21 additions and 7 deletions

View File

@@ -2514,14 +2514,15 @@ namespace ts {
}
export function getEffectiveBaseTypeNode(node: ClassLikeDeclaration | InterfaceDeclaration) {
if (isInJSFile(node)) {
const baseType = getClassExtendsHeritageElement(node);
if (baseType && isInJSFile(node)) {
// Prefer an @augments tag because it may have type parameters.
const tag = getJSDocAugmentsTag(node);
if (tag) {
return tag.class;
}
}
return getClassExtendsHeritageElement(node);
return baseType;
}
export function getClassExtendsHeritageElement(node: ClassLikeDeclaration | InterfaceDeclaration) {