jsdoc-toolkit 不喜欢我的语法?
我是第一次使用 jsdoc,它似乎不太喜欢我的语法,而且我找不到它喜欢的任何内容:
(function(){ // issue #1
/**
* Creates an instance of a Cube animation
* @class
*/
function Cube(x, y, z){
...
}
/** @lends Cube.prototype */
cubeFrame.prototype = { // Issue #2
...
}
})();
问题 #1:出于某种原因,我收到错误“警告:尝试将 someMethod 记录为未记录符号 Cube 的成员。”如果我保留该包装函数。如果我将其注释掉,它就会起作用。
问题#2:我在类中做了一些奇怪的事情,并且当我在应用以下内容时说 @lends Cube.prototype
时,无法找到让 jsDoc 注意到的方法对象为 Cube
而不是 cubeFrame
。我收到与 #1 几乎相同的错误:“警告:尝试将 getVoxel 记录为未记录符号 cubeFrame 的成员。”。我不希望 cubeFrame
被记录下来,我希望它的原型进入 Cube
文档。
我可以重写这两行并获取要生成的文档(然后它是无效代码),但我不想每次进行更改时都必须重新编写代码来生成文档!
I'm using jsdoc for the first time and it doesn't seem to like a bit of my syntax and I can't find anything it does like:
(function(){ // issue #1
/**
* Creates an instance of a Cube animation
* @class
*/
function Cube(x, y, z){
...
}
/** @lends Cube.prototype */
cubeFrame.prototype = { // Issue #2
...
}
})();
Issue #1: For some reason I get an error of "WARNING: Trying to document someMethod as a member of undocumented symbol Cube." if I leave that wrapping function in. If I comment it out, it works.
Issue #2: I'm doing something a bit odd with my classes and can't figure out a way to get jsDoc to pay attention when I say @lends Cube.prototype
in terms of applying the following object to Cube
and not cubeFrame
. I get a nearly identical error to #1: " WARNING: Trying to document getVoxel as a member of undocumented symbol cubeFrame.". I don't want cubeFrame
to be documentated, I want its prototypes to go into the Cube
documentation.
I can re-write those two lines and get the documentation to generate (it's then invalid code), but I don't want to have to re-write code to generate documentation every time I make a change!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
@name
标签让 jsdoc 知道对象的名称,然后是类的名称,并将@lends
标签替换到对象字面量之前。喜欢:Use the
@name
tag to let jsdoc know the name of the object, then name of the class and replace the@lends
tag to right prior to the object literal. Like: