microsoft / microsoft/TypeScript

JSDoc property name is not parsed as expected when non-alphanumeric characters are present and intellisense not showing properties

オープン
#36,047 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

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

説明

TS Template added by @mjbvz

TypeScript Version: 3.8.0-dev.20200104

Search terms:

  • jsdoc / jsdocs
  • completionInfo

  • VSCode Version: 1.41.1 (user setup)
  • OS Version: Windows_NT x64 10.0.17134

Origin of this discovery:
I was trying to document my types which translate to XML classes. The syntax for which includes the "@class" as a property name of my object. This is not possible given the current syntax parsing in VSCode.

Steps to Reproduce:

  1. Place this code in the editor with the language as Javascript
    Code:
/**
 * @typedef Foo
 * @property {string} bar Property shows in intellisense
 * @property {string} @baz Property should show in intellisense but does not
 * @property {string} test Property should show in intellisense but does not
 * @property {string} @class Property name "@class" should be a possible property name that
 * does not get interpreted as a JSDoc instruction.
 * @property {string} even#ThisShouldBeAValidName! But the name is not parsed as expeted
 */

/**
 * @type {Foo}
 */
const fooInstance = {
	
}
  1. Prompt the intellisense to show within the "fooInstance" object.
    1. Expected: The properties @ baz and @ class should be highlighted like normal property names
      1. Actual: The properties are shown as if they were JSDoc instructions
    2. Expected: The property "even#ThisShouldBeAValidName!" should be highlighted like a normal property name
      1. Actual: The property is highlighted as expected until the "#" symbol and then it seems to be treated like a comment
    3. Expected: Intellisense should show all the properties
      1. Actual: Only the first property "bar" is shown. An empty string "" is shown as if it were another property name.

Does this issue occur when all extensions are disabled?: Yes

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

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

はじめの一歩

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

調査の方向性

まず、この issue のコードサンプルを使って、JavaScript エディターでの JSDoc typedef と completionInfo の動作を再現します。@property の名前がどのように解析され、補完がどのように生成されるかを追跡します。@、#、! を含む名前が保持され、列挙されたすべてのプロパティが IntelliSense に表示されれば完了です。

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

評価

技術スタック
javascript, typescript
領域
compilers, devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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