问题描述
但是该类的构造函数的jsDoc行号指向该类的顶部,而不是构造函数。即使使用@constructor
也无济于事。
有没有办法强迫jsDoc指向ctor,而不是类声明?
Ex:源文件
import util from './util.js'
/**
* Subclass of Array with convenience methods used by Netlogo.
* Typically the items in the array are Objects but can be any type.
*/
class AgentArray extends Array {
/**
* Convert an existing Array to an AgentArray "in place".
* Use array.slice() if a new array is wanted
*
* @static
* @param {Array} array Array to convert to AgentArray
* @return {AgentArray} array converted to AgentArray
*/
static fromArray(array) {
const aarray = Object.setPrototypeOf(array,AgentArray.prototype)
return aarray
}
/**
* Creates an instance of AgentArray. Simply pass-through to super()
* Now,but may add initialization code later.
* @param {*} args Zero or more items in Array
* @example
* let aa = new AgentArray({x:0,y:0},{x:0,y:1},{x:1,y:0})
* //=> [{ x: 0,y: 0 },{ x: 0,y: 1 },{ x: 1,y: 0 }]
*/
constructor(...args) {
super(...args)
// maybe do some initialization later
}
}
jsDoc html文件:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)