Javascript VS代码-如何使用JSDoc记录原型方法和属性
我有这样一段代码:Javascript VS代码-如何使用JSDoc记录原型方法和属性,javascript,visual-studio-code,jsdoc,Javascript,Visual Studio Code,Jsdoc,我有这样一段代码: //line 0 /** * Constructor of class Person * @class * @constructor * @param {string} name Name of person * @param {string} surname Surname of person * @param {number} age Age of person */ function Person(name, surname, age){ t
//line 0
/**
* Constructor of class Person
* @class
* @constructor
* @param {string} name Name of person
* @param {string} surname Surname of person
* @param {number} age Age of person
*/
function Person(name, surname, age){
this.name = name;
this.surname = surname;
this.age = age;
}
/** Optional for my project, MISSING JSDOC */
Person.prototype = {
//..somethings..
/** MISSING JSDOC */
talk: function(){
//..somethings..
},
/** MISSING JSDOC */
walk: function(){
//..somethings..
},
/** MISSING JSDOC */
foo: function(){
//..somethings..
p.bar();
//..somethings..
}
};
/**
* A shortcut to access to {@link Person} methods' more easly
* @type {Object} p
*/
var p = Person.prototype;
//something else
但我不知道如何使用IntelliSense对.prototype对象进行注释,以查看属性或方法的描述以及可能的类型。
我以前尝试过在StackOverflow和其他网站上搜索,但没有什么是真正有用的。
抱歉,英语不好。使用@memberof标记标识符。请参阅文档和使用示例:
您可能还想使用@alias从文档中排除“prototype”。用法示例和文档:@memberof不适用于vscode salsa/intellisense,并且未在typescript支持的jsdoc标记中列出