Skip to content

Add JSDoc's @inheritDoc Support for Static Class Members for TypeScript #23215

Closed
@CatGuardian

Description

@CatGuardian

TypeScript Version: 2.7.2

Search Terms:
IntelliSense
static
subclass
JSDoc
Class
Members
inheritDoc

Code

abstract class BaseClass {
  /**
   * Useful description always applicable
   * 
   * @returns {string} Useful description of return value always applicable.
   */
  public static doSomethingUseful(stuff?: any): string {
    throw new Error('Must be implemented by subclass');
  }

  /**
   * Applicable description always.
   */
  public static readonly someProperty: string = 'general value';
}




class SubClass extends BaseClass {

  /**
   * @inheritDoc
   * 
   * @param {{ tiger: string; lion: string; }} [mySpecificStuff] Description of my specific parameter.
   */
  public static doSomethingUseful(mySpecificStuff?: { tiger: string; lion: string; }): string {
    let useful = '';

    // do something useful to useful

    return useful;
  }

  /**
   * @inheritDoc
   */
  public static readonly someProperty: string = 'specific to this class value'
}

Expected behavior:
For someProperty I expect the JSDocs describes for BaseClass.someProperty to show up exactly for SubClass.someProperty

For doSomethingUseful(...) I expect the documentation that was provided for BaseClass.doSomethingUseful to show up for SubClass.doSomethingUseful. I also expect the extra documentation (the parameters in this case) for SubClass.doSomethingUseful to also show up in the intellisense documentation for SubClass.doSomethingUseful.

Actual behavior:
The actual behavior is that the static properties of SubClass is not getting inherited docs from BaseClass

Related Issues:
#8912
#7084

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions