microsoft / microsoft/TypeScript

JSDoc @name tag does not function

オープン
#31,622 コメント 2 件 リアクション 10 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

  • VSCode Version: 1.33.1
  • OS Version: Windows 7 x86_64 (but I do not think that is relevant)
  • Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Write in a file with .js or .ts extension the below sample code:
/**
  Construct a new component

  @class Component
  @classdesc A generic component

  @param {Object} options - Options to initialize the component with
  @param {String} options.name - This component's name, sets {@link Component#lastProperty}
  @param {Boolean} options.visible - Whether this component is vislble, sets {@link Component#firstProperty}
*/
function Component(options) {
  /**
    Whether this component is visible or not

    @name Component#firstProperty
    @type Boolean
    @default false
  */
  this.firstProperty = options.visible;

  /**
    This component's name

    @name Component#lastProperty
    @type String
    @default "Component"
    @readonly
  */
  Object.defineProperty(this, 'lastProperty', {
    value: options.name || 'Component',
    writable: false
  });
}

const myComponent = new Component({});
  1. on a new line at the end of the document type myComponent with a dot at its end.
  2. While the text-cursor is after the dot, press Ctrl+Space to open the auto-completion list.

Current Behavior:

When you chose .js as file extension, only firstProperty is in the auto-completion list (with its type comment and so on).

But when you have it in a file with .ts extension, none of firstProperty and lastProperty will be detected, and JSDoc seems useless.

Expected Behavior:

Both firstProperty and lastProperty should be detected and get placed in the auto-completion list, and that no matter which of .js or .ts file extensions we are using.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

指定された Component の例を .js ファイルと .ts ファイルの両方で再現し、その後 myComponent. の後の補完の動作を確認します。それぞれのファイル形式で、JSDoc によって定義されたどのプロパティが検出されるかを比較します。完了条件は、両方の拡張子の補完リストに firstPropertylastProperty の両方が表示されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。