jsdoc-to-markdown icon indicating copy to clipboard operation
jsdoc-to-markdown copied to clipboard

Including documentation for methods inherited via extends

Open djipco opened this issue 4 years ago • 2 comments

I have a class that extends another one. Is it possible for the child class to include documentation for inherited methods? I'm only getting documentation for the actual methods in the class and not the inherited ones.

I can see that my @extends keyword is picked up because it shows up in the generated docs. This is basically my setup:

/**
 * Vehicle Class
 */
class Vehicle {
  start() {
    // Vroom!
  }
}
import {Vehicle} from "./Vehicle.js";
/**
 * Tank Class
 * @extends Vehicle
 */
class Tank extends Vehicle {
  fire() {
    // fire!
  }
}

In the documentation for the Tank class, I see the fire() method but not the start() method. Is that normal?

djipco avatar Oct 05 '21 18:10 djipco

Hi, does your inherited method document as expected using jsdoc directly? If not, it's likely an issue with jsdoc (which jsdoc2md uses internally).. Check their issue log..

75lb avatar Oct 06 '21 18:10 75lb

I am exporting the same documentation to HTML with foodoc (a template for jsdoc) and the inherited methods are all there.

There is an issue with jsdoc that mentions that inherited properties are not documented but that also confirms that inherited methods are indeed documented.

djipco avatar Oct 07 '21 02:10 djipco