如何为Eclipse jsdt添加jsdoc以使匿名函数自动完成?

时间:2014-05-23 12:27:52

标签: javascript jsdoc jsdt

参见示例我尝试使用自动完成和文档代码,但@param信息被忽略 - 如何正确执行jsdoc?

/**
 * @constructor
 */
function WhiteClass() {
    this._rgb = [1.0, 1.0, 1.0]
}

/**
 * @constructor
 */
function ColorClass() {

}

ColorClass.prototype = {
    constructor: RedClass,

    /**
     * @param {WhiteClass} whiteInstance
     */
    attachWhite: function (whiteInstance) {
        this._white = whiteInstance;
        /** @type {WhiteClass} */
        this._white2 = whiteInstance;
    },

    otherAction: function() {
        // this._white. <- autocompletion not works since type is any @param is ignored - how to make @param working?
        // this._white2. <- autocompletion works but @param is ignored only @type is used
    }
}

0 个答案:

没有答案