下列的这些 vsdoc 文档指南 http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx,我无法让智能感知对给定类型的数组正常工作。这是一些演示问题的代码
function MyType() {
/// <summary>Class description here</summary>
/// <field name="PropertyA" type="Boolean">Description of Property A</field>
/// <field name="PropertyB" type="String">Description of Property B</field>
}
MyType.prototype.PropertyA = false;
MyType.prototype.PropertyB = "";
function testFunc(arrayOfMyType) {
/// <summary>Description of testFunc</summary>
/// <param name="arrayOfMyType" type="Array" elementType="MyType">asdfasdf</param>
// right here, I should get the intellisense for an item of type MyType but I don't
arrayOfMyType[0].
}
就在之后arrayOfMyType[0]
我应该获得 MyType 的智能感知,但我没有。我还尝试了 for-in 循环来查看是否会产生正确的智能感知,但事实并非如此。我应该注意的是arrayOfMyType
确实有适当的智能感知Array
,如果我将其更改为Array
to MyType
然后我得到了正确的智能感知,但不是作为Array
类型的MyType
正如示例中评论的那样。
目前我只能访问 pre-sp1 vs2010,所以我不确定这是否是他们已经修补的错误。
谁能告诉我如果
- 我的 vsdoc xml 注释写得不正确
- 我关于期望在该行获得 MyType 的智能感知是否正确
- 上述代码片段的智能感知适用于 vs2010 sp1
http://msdn.microsoft.com/en-us/library/vstudio/hh542725.aspx http://msdn.microsoft.com/en-us/library/vstudio/hh542725.aspx
function Point(x, y) {
/// <summary>My class.</summary>
/// <field name="x" type="Number">X coordinate</field>
this.x = x;
/// <field name="y" type="Number">Y coordinate</field>
this.y = y;
}
function testFunc(arrayOfMyType) {
/// <summary>Do a thing</summary>
/// <param name="arrayOfMyType" type="Array" elementType="Point">Array of Points</param>
// Do something
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)