Comment nested module class with JSDoc3

断了今生、忘了曾经 提交于 2020-01-14 03:06:29

问题


I'm dealing with a module pattern in WebStorm's live inspection that I'm trying to comment.
And I don't want to use AMD/CJS.

;
My = (window.My || {});
My.Module = (My.Module || {});
My.Module.MyClass = (/**
 *
 * @param {My.Module.MyAnotherClass} MyAnotherClass
 */
    function (MyAnotherClass) {
    'use strict';

    /**
     * @class
     */
    var MyClass = function() {
        // constructor
    };

    /**
     * My sexy method.
     * @param {string} s
     */
    MyClass.prototype.myMethod= function(s) {
        var test = new MyAnotherClass(s);
    };

    return MyClass;
})(My.Module.MyAnotherClass);

Pretend that "MyAnotherClass" has the same type of comment. My issue is when I'm trying this : var test = new MyAnotherClass(s);, WebStorm is telling me that Method expression is not of Function type.

What can I do ?

Tell me if you need more information and sorry for my bad english.

L.

EDIT: It seems that removing the very first comment block with param definition is resolving the issue ... but I don't feel like it's the best way to go.

EDIT2: Same issue with property from an abstract class

来源:https://stackoverflow.com/questions/32778278/comment-nested-module-class-with-jsdoc3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!