以 vsdoc 格式记录 javascript 的 T 类型数组,我发现错误了吗?
遵循 这些 vsdoc 指南文档,我一直无法让智能感知对给定类型的数组正常工作。下面是一些演示问题的代码,
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
更改为 MyType
然后我得到了正确的智能感知,但不是作为示例中注释的 MyType
类型的 Array
。
目前我只能访问 sp1 之前的 vs2010,所以我不确定他们是否修复了这个错误。
谁能告诉我,如果
- 我写的 vsdoc xml 注释不正确,
- 我是否期望在该行获得 MyType 的智能感知 上述代码
- 片段的智能感知适用于 vs2010 sp1
Following these guidelines for vsdoc documentation, I've been unable to get intellisense to work properly for an array of a given type. Here is some code that demos the problem
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].
}
Right after arrayOfMyType[0]
I should get intellisense for MyType but I don't. I've also tried a for-in loop to see if that would bring up the right intellisense but it doesn't. I should note that arrayOfMyType
does have proper intellisense for an Array
, and if I change it from Array
to MyType
then I get the correct intellisense for that, but not as an Array
of type MyType
as commented in the example.
At the moment I only have access to pre-sp1 vs2010 so I'm not sure if its a bug they've patched or not.
Could anyone tell me if
- I'm writing my vsdoc xml comments incorrectly
- I'm correct or not about expecting to get the intellisense for MyType at that line
- The intellisense for the above snippet works in vs2010 sp1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://msdn.microsoft.com/en-us/library/vstudio /hh542725.aspx
http://msdn.microsoft.com/en-us/library/vstudio/hh542725.aspx
VS ItelliSense 不支持 JS XML 文档注释的所有功能。我想这是不受支持的之一。
VS ItelliSense does not support each and every feature of JS XML doc comments. I guess this is one of the unsupported ones.