Skip to content

Using @extends in JavaScript + JSDoc removes method documentationsΒ #50117

@jespertheend

Description

@jespertheend

Bug Report

πŸ”Ž Search Terms

jsdoc extended generic class documentation

πŸ•— Version & Regression Information

  • This changed between versions 4.6.4 and 4.7.4

⏯ Playground Link

πŸ’» Code

/** @template T */
class GenericBaseClass {
	/** Method documentation. */
	method() {}
}

/** @extends {GenericBaseClass<number>} */
class GenericExtendedClass extends GenericBaseClass {
	// hover over 'method' to see the documentation
	method() {}
}

const y = new GenericExtendedClass();
// hover over 'method' to see the documentation
y.method;

πŸ™ Actual behavior

When hovering over y.method or the method() implementation from GenericExtendedClass the documentation of the method is missing.

πŸ™‚ Expected behavior

Hovering reveals the inherited documentation from the parent class. This used to work in TypeScript 4.6.4 and still works when using TypeScript, where Generic classes are extended using GenericBaseClass<number> syntax. Only in JavaScript, where @extends {GenericBaseClass<number>} is used, will the documentation disappear. When extending classes that don't have any generic parameters this also still works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationDomain: Quick Infoe.g. hover text, tool-tips, and tooltips.Help WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions