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

This commit is contained in:
Klaus Meinhardt authored and Nathan Shively-Sanders committed 2019-02-05 15:51:55 -08:00
1 parent 7c096576bc
commit 12edac0925
4 files changed
+21 -7

No files matched your search

+3 -2
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) {