microsoft / microsoft/TypeScript
JSDoc property name is not parsed as expected when non-alphanumeric characters are present and intellisense not showing properties
オープン
まだ誰も着手していません。
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:
- 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 = {
}
- Prompt the intellisense to show within the "fooInstance" object.
- Expected: The properties @ baz and @ class should be highlighted like normal property names
- Actual: The properties are shown as if they were JSDoc instructions
- Expected: The property "even#ThisShouldBeAValidName!" should be highlighted like a normal property name
- Actual: The property is highlighted as expected until the "#" symbol and then it seems to be treated like a comment
- Expected: Intellisense should show all the properties
- Actual: Only the first property "bar" is shown. An empty string "" is shown as if it were another property name.
- Expected: The properties @ baz and @ class should be highlighted like normal property names
Does this issue occur when all extensions are disabled?: Yes
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、この issue のコードサンプルを使って、JavaScript エディターでの JSDoc typedef と completionInfo の動作を再現します。@property の名前がどのように解析され、補完がどのように生成されるかを追跡します。@、#、! を含む名前が保持され、列挙されたすべてのプロパティが IntelliSense に表示されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers, devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100