microsoft / microsoft/TypeScript
Should intellisense suggest block scoped values before they are declared?
オープン
まだ誰も着手していません。
Domain: LS: Completion Lists
Experience Enhancement
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Currently intellisense suggests every block scoped declaration in scope, even if the suggestion is located within the TDZ. When accepting that suggestion, TypeScript issue an used before its declaration error:
new /**/; // suggests 'Clazz', which results in an error
class Clazz {}
function test(
foo = /**/, // suggests `foo`, `bar` and `baz`, all of them result in an error
bar = /**/, // suggests `bar` and `baz`, both result in an error
) {
let baz = 1;
}
Should intellisense filter out suggestions that would result in an error? If so, it should probably use the same condition as the checker.
Related: #28472 #28471
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイルやテストは指定されていません。まず、ブロックスコープ宣言に対する IntelliSense の補完ロジックを見つけ、そのフィルタリングを checker の used-before-declaration 条件と比較します。Clasz、foo、bar、baz などの TDZ により無効な候補が除外され、正しい候補は引き続き利用可能になれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- developer-experience
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100