microsoft / microsoft/TypeScript
Completion does not work for generic type extending tuple or array of all partial type
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
### Extension Version
0.20251202.1
### VS Code Version
1.103.2
### Operating system Version
Linux Mint 22.2 Zara
### Steps to reproduce
1. Paste the following code into VS Code.
2. In each example, type com... and check whether it is auto-completed.
### Issue
```ts
// All partial type works
type AllPartialObject = {
component?: string
}
declare function extendTheme1(
extensions: Extensions
): void
extendTheme1([
{
/* Can autocomplete `component` here */
},
])
// But all partial type with mapped types doesn't work
declare function extendTheme2<
Extensions extends [AllPartialObject & Record],
>(extensions: Extensions): void
extendTheme2([
{
/* Can't autocomplete `component` here */
},
])
// with required field works
type PartialWithRequiredObject = {
component?: string
requiredField: string
}
declare function extendTheme3<
Extensions extends [PartialWithRequiredObject & Record],
>(extensions: Extensions): void
extendTheme3([
{
/* Can autocomplete `component` here */
},
])
// but with required field and complete required field doesn't work
extendTheme3([
{
requiredField: 'foo',
/* Can't autocomplete `component` here */
},
])
// also BaseTheme with no mapped types doesn't work too
declare function extendTheme4(
extensions: Extensions
): Extensions
extendTheme4([
{
requiredField: 'foo',
/* Can't autocomplete `component` here */
},
])
// no extend tuple works
declare function extendTheme5<
Extensions extends AllPartialObject & Record,
>(extensions: [Extensions]): Extensions
extendTheme5([
{
/* Can autocomplete `component` here */
},
])
```
Original issue: https://github.com/microsoft/TypeScript/issues/45617
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue の TypeScript の例を使って VS Code で extendTheme1 から extendTheme5 までの補完の違いを再現し、次にリンクされている元の issue と動作を比較します。現在失敗しているジェネリックタプルと mapped type のケースでコンポーネント補完が表示され、動作している例にリグレッションがないことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript, vscode
- 領域
- compilers, developer-experience
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100