我有类似的东西:
/**
* @class
*/
NS.MyAwesomeObject = Class.create();
NS.MyAwesomeObject.prototype = {
/**
* @param id - the id
* @return - an alert dialog with an id
*/
initialize : function(id){
alert(id);
}
}
我错过了什么吗?我起床去 NS。 -> 自动完成:MyAwesomeObject,但我想要 NS.MyAwesomeObject。 -> 自动完成:初始化(id)。
当我不使用 Class.create() 时,它在其他情况下工作得很好。我用谷歌搜索了solution是添加@class,但这对我不起作用。
谢谢!
最佳答案
它对我有用。 BTW Eclipse没有JSDOC 3支持。 使用JSDOC 3您的代码看起来:
var NS = {};
/** @class */
NS.MyAwesomeObject = Class.create(
/** @lends NS.MyAwesomeObject.prototype */
{
/**
* @constructs
* @param {Number} id - the id
* @returns {Void} - an alert dialog with an id
*/
initialize:function (id) {
alert(id);
}
});
jsDoc 3 的代码补全现在仅适用于 WebStorm(或其他 Jetbrains 产品)。
关于javascript - Eclipse 中的 JSDoc 自动完成文档不适用于 Class.create(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10803998/