2011-06-09 19 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

相關問題