2011-06-09 46 views
2

正在关注these guidelines for vsdoc documentation,我一直无法让intellisense为给定类型的数组正常工作。下面是一些演示问题为javascript编写vsdoc格式的T类型数组,我发现了一个Bug?

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循环,看看是否会出现正确的intellisense,但它不会。我应该注意到arrayOfMyTypeArray确实具有正确的智能感知,并且如果将其从Array更改为MyType,那么我会得到正确的智能感知,但不会像MyType类型的Array那样在示例中评论。

目前我只能访问sp1 vs2010之前的版本,所以我不确定它是否修补了一个bug。

谁能告诉我,如果

  • 我在写我的vsdoc XML注释错误
  • 我正确与否对期待得到的MyType智能感知在该行
  • 的智能感知上面的代码片段可以在vs2010 sp1中运行

回答

3

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 
} 
1

VS ItelliSense不支持JS XML文档注释的每个功能。我想这是不支持的之一。

+0

这就是太糟糕了,我得向微软连接,并提出确保为特征/检查,如果其未实现。它也是一个耻辱,因为我有一些非常棒的js intellisense的东西出来,如果这个功能被实现, – 2011-06-13 12:42:03

相关问题