documentation icon indicating copy to clipboard operation
documentation copied to clipboard

May I not use @memberof on every class member?

Open sineway opened this issue 5 years ago • 1 comments

Running from CLI, version 13.0.1

I use the following pattern to create a mix-in:

function createClass(superClass) {
    /**
        @class
    */
    return class MyClass extends superClass {
        /**
            @memberof MyClass#
        */
        myMethod() {}
    }
}

The thing is, if I not declare @memberof, then method is documented as global scope function.

My question, is there a way to not declare @memberof on every class member?

sineway avatar Jun 18 '20 15:06 sineway

In this context, the return statement disables membership detection. This modified code works:

function createClass(superClass) {
  /**
        @class
    */
  class MyClass extends superClass {
    /**
     * Test
     */
    myMethod() {}
  }

  return MyClass;
}

If you want to look into a fix, the membership inference happens here: https://github.com/documentationjs/documentation/blob/master/src/infer/membership.js

tmcw avatar Nov 14 '20 21:11 tmcw