局部变量的正确JSDoc语法是什么? [英] What is the correct JSDoc syntax for a local variable?
问题描述
对于这样的函数...
For a function like this...
function example() {
var X = 100;
...
var Y = 'abc';
...
return Z;
}
我需要解释一些局部变量的用途。添加这样的描述...
I need to explain the purpose of some of the local variables. Adding a description like this...
function example() {
/**
* @description - Need to explain the purpose of X here.
*/
var X = 100;
...
/**
* @description - Need to explain the purpose of Y here.
*/
var Y = 'abc';
...
return Z;
}
...似乎没有得到 JS Doc v3.4.0
。
...doesn't seem to be getting picked up by JS Doc v3.4.0
.
正确的语法是什么?
PS我的一些用例需要多行注释。
P.S. Some of my use cases call for multi-line comments.
推荐答案
似乎JS Docs忽略了块中的注释(例如,阶级,功能等)。我试过......
It seems that JS Docs ignores comments within the "block" (E.g. class, function, etc.). I tried...
@description
@inner
@instance
@member
@memberof
@name
@summary
...和其他。我无法让他们中的任何一个生成文档。在整个JS Doc示例中,他们使用普通的JS注释来处理这类事情。
...and others. I was unable to get any of them to generate documentation. Throughout the JS Doc examples they use normal JS comments for this sort of thing.
我得出结论 没有正式的JS Doc语法。
I have concluded that there is no official JS Doc syntax for this.
这篇关于局部变量的正确JSDoc语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!