2013-12-17 23 views
5

活字体インテリセンスが、このために正常に動作脂肪の矢印の機能と連携されていません。Visual Studioのインテリセンスは

class SampleClass { 
    /** 
    * Does stuff 
    * 
    * @param blah stuff needing done 
    */ 
    public doStuff(blah: string) { 
    } 
} 

var sample = new SampleClass(); 
// intellisense works correctly and shows parameter description: 
sample.doStuff("hello"); 

は、しかし、脂肪の矢印を使用するように切り替えJSDocのインテリセンス(メソッドのシグネチャは、まだ表示されますが、壊れているようですjsdocの説明はありません)。

class SampleClass2 { 
    /** 
    * Does stuff 
    * 
    * @param blah stuff needing done 
    */ 
    public doStuff = (blah: string) => { 
    } 
} 

var sample2 = new SampleClass2(); 
// intellisense gives the method signature still but no longer picks up any of the jsdoc descriptions: 
sample2.doStuff("hello"); 

私はVisual Studio 2012 Update 4を使用しています。 TypeScript 0.9.5。

これはバグですか、またはjsdocコメントに別の構文を使用する必要がありますか?

答えて

4

これは活字体遊び場で動作しますなぜ私は正直なところ非常に混乱しています。

のVisual Studioでこの仕事を持っているために、機能のドキュメントは、関数式自体にする必要があります:

class SampleClass2 { 
    public doStuff = 
     /** 
     * Does stuff 
     * 
     * @param blah stuff needing done 
     */ 
    (blah: string) => { 
    } 
} 

var sample2 = new SampleClass2(); 
sample2.doStuff("hello"); 
0

私はVisual Studio 2013を使用していますので、正確なセットアップはテストできませんが、どちらの例でもタイプヒントと自動補完を取得する必要があります。

JSDocのと活字体の遊び場からのスクリーンショット...

enter image description here

+0

彼はコメントについて話してはい、動作するようには思えない、自動補完を知っています遊び場で試しました。 –

+0

私のために働く。スクリーンショットが追加されました。 – Fenton

+1

入力すると機能しません。 after sample2 –