Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherited Documentation #1338

Closed
Alon-L opened this issue Jul 19, 2020 · 1 comment
Closed

Inherited Documentation #1338

Alon-L opened this issue Jul 19, 2020 · 1 comment
Labels
enhancement Improved functionality

Comments

@Alon-L
Copy link

Alon-L commented Jul 19, 2020

Search Terms

Inherited Documentation, Abstract Documentation, Class Extend Documentation

Problem

There currently doesn't seem to be a way to inherit documentation for properties or methods implemented from abstract classes (might also be the case when extending classes, haven't checked).

Suggested Solution

Documentation for a property or method you implement should be inherited from the abstract class you implemented unless an override is present.

e.x.

abstract class A {
  /**
   * This is the description for a.
   */
  abstract a: string;

  /**
   * This is the description for print.
   * @returns {void}
   */
  abstract print(): void;
}

class B implements A {
  // The description for 'a' will be inherited from A - 'This is the description for a.'
  public a: string = 'b';

  // The description and additional attributes for 'print' will be inherited from A.
  public print(): void {
    console.log(this.a);
  }
}

class C implements A {
  // The description for 'a' will be overriden
  /**
   * This is a new description for a.
   */
  public a: string = 'b';

  // The description for 'print' will be overriden
  /**
   * This is a new description for print.
   * @returns {void} new return description
   */
  public print(): void {
    console.log(this.a);
  }
}
@Alon-L Alon-L added the enhancement Improved functionality label Jul 19, 2020
@Alon-L
Copy link
Author

Alon-L commented Jul 23, 2020

Just saw issue #787
Thank you for implementing this!

@Alon-L Alon-L closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

1 participant