microsoft / microsoft/TypeScript

Add refactoring action to annotate a variable or a function signature component with its inferred type

オープン
#13,199 コメント 15 件 リアクション 20 件 担当者 0 名 GitHub で見る

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

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

説明

Hi, I'm using latest stable VSCode / latest nightly TS and I'm not sure if codefixes and refactorings have been implemented there yet, in any case, having a refactoring option to take any variable which receives an implicit inferred type, say, through a function call:

function test(): number[] {
  // ...
}

let x = test(); 

And being able to right-click x and invoke an action like Annotate with inferred type (or Extract inferred type), such that the resulting statement would look like:

let x: number[] = test();

could be very useful!

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

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

はじめの一歩

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

調査の方向性

VSCodeで使用されているTypeScriptのcodefixおよびリファクタリングの動作から始め、最新のnightly版TypeScriptで例を再現します。推論された変数型と関数シグネチャの構成要素をアクションでどのように扱うべきかを定義し、let x: number[] = test(); のようなアノテーションが生成されることを確認します。

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

評価

技術スタック
typescript
領域
compilers
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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