microsoft / microsoft/TypeScript
How to jump to the definition of a template string type in VSCode?
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
- VS Code Version: 1.82.2
- OS Version: win11
I’m using TypeScript 5.2.2 and VSCode 1.82.2, and I have a problem with jumping to the definition of a template string type.
Here is my code:
type Test<T extends object> = {
[K in keyof T]: () => void
} & {
[K in keyof T as `${string & K}Sync`]: () => void
}
const a = {
getValue() {}
}
const b = {} as Test<typeof a>
b.getValueSync()
b.getValue()
I want to jump to the definition of the Test type, but when I press F12 on getValueSync, nothing happens. However, when I press F12 on getValue, it works fine and jumps to the definition of a.getValue.
I wonder if this is a bug or a limitation of VSCode or TypeScript, and how can I solve it. Any help or suggestion would be appreciated. Thank you.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue にある template literal mapped type の例を使用して、TypeScript 5.2.2 と VS Code 1.82.2 で報告された F12 の動作を再現します。リポジトリのファイルやテストは指定されていません。getValueSync に対する language service の定義リクエストを追跡し、その後 getValue と比較して動作を確認し、期待される結果を文書化するかテストしてください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript, vscode
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100