microsoft / microsoft/TypeScript
Infer-from-usage should find references of related tokens
オープン
まだ誰も着手していません。
Domain: LS: Quick Fixes
Experience Enhancement
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Based on code in acorn:
var TokenType = function TokenType(label, conf) {
this.label = label
this.binop = conf.binop || null
}
/**
* @param {string} name
* @param {number} prec
*/
function x(name, prec) {
return new TokenType(name, { binop: prec })
}
Expected behavior:
TokenType's inferred type should be (label: string, conf: { binop: string }) based on usage in x.
Actual behavior:
TokenType's inferred type is (label: any, conf: { binop: null }), based only on usage inside TokenType itself.
I don't think infer-from-usage supports any JS assignment patterns; this is just the first one I ran into.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue の acorn 例から始め、TokenType コンストラクターと x 関数の infer-from-usage 処理を追跡します。関連するトークンの代入パターンと参照がどのように収集されるかを確認します。推論された型に any と null ではなく label: string と conf: { binop: string } が含まれていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100