Typescript - inlay hints for nested labeled tuples
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
調査の方向性
issue 内のネストされたラベル付きタプルの例から始め、すべてのインレイヒントを有効にした状態で VS Code で再現します。ネストされた配列の呼び出しを、動作する rest-parameter の呼び出しと比較し、その後、タプルラベルを担当する TypeScript のインレイヒントのエントリポイントをたどります。完了条件は、既存の例を後退させることなく、ネストされた minVals と maxVals のラベルが期待される位置に表示されることです。
索引モデルが issue の本文から書いたものです。
説明
Type: Feature Request
The inlay hints for an array of labeled tuples are forgotten.
Troubleshooting steps:
- Ensured Typescript is fully up-to-date.
- Enabled all inlay hints in vsCode settings.
When a type is described as tuple with labels, you can use the ...args: ThatTupleType and when calling the function, the parameters retain the labels. This is working just fine.
However, when the argument is more complex, and there are nested labeled tuples within the type, the inlay hint information is lost (although the type information is still there; TypeScript still knows that the labels are on the array).
The expectation is that if I pass an array of tuples to an argument or type that expects the tuples to adhere to rules, and the type has labels, that the inlay hints should show those nested labels in the appropriate place.
The below example will showcase the issue I'm referring to, when it's run in vsCode with all inlay hints enabled:
type ArmorValueSet = [number, number, number, number, number, number];
type ArmorValueRange = [minVals: ArmorValueSet, maxVals: ArmorValueSet];
const parseArmor = (
armorValues: ArmorValueRange[]
) => {
console.log(armorValues);
};
parseArmor([
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
]);
const test = (...args: ArmorValueRange) => {
console.log(...args);
}
test([6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]);
On line 22, minVals and maxVals are shown correctly. However, from lines 11-15, there are no inlay hints for these tuple labels. The expectation is that each of these lines should look the same as line 22 in terms of the inlay hints that are shown.
Here is a screenshot of what my vsCode editor looks like with this code present:
VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z)
OS version: Windows_NT x64 10.0.19045
Modes:
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 106
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TypeScript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/TypeScript#64322 · コメント 2 件 · リアクション 1 件 · 担当者 2 名 ·
-
Possible Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/TypeScript#64278 · コメント 1 件 · リアクション 1 件 ·
-
Docs
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
microsoft/TypeScript#64118 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/TypeScript#64094 ·
-
Docs
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/TypeScript#63959 · コメント 5 件 ·
microsoft/TypeScript の issue をすべて見る
似ている issue
-
Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenNSW/nsw-srilanka#497 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
milvus-io/birdwatcher#545 ·
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
kubernetes-sigs/prow#953 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
caddyserver/caddy#8046 ·