microsoft / microsoft/TypeScript

Destructured function does not show outline of inner function parameters

オープン
#63,551 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

説明

### 🔎 Search Terms

outline model

### 🕗 Version & Regression Information

- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______

### ⏯ Playground Link

_No response_

### 💻 Code

```ts
// Your code here
```

### 🙁 Actual behavior

Essentially for the code:

```
export const [var1, var2] = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

The outline model returned by TypeScript does not show a, b and c. But for:

```
export const abc = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

It does.

### 🙂 Expected behavior

I would expect a, b, and c to be visible in the outline model in both cases.

### Additional information about the issue

Hi, I am a developer on the VS Code team, and I recently received the following bug : https://github.com/microsoft/vscode/issues/241563. The bug is that the VS Code editor sticky scroll does not display the expected sticky lines. This happens because the outline model returned by the TypeScript server changes unexpectedly depending on if the function return variable is destructured or not. I attach a screen recording here to show the issue.

Essentially for the code:

```
export const [var1, var2] = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

The outline does not show a, b and c. But for:

```
export const abc = processLightDarkTokens({
a : {
b : {

}
},
c : {

}
});
```

It does. Is this expected?

https://github.com/user-attachments/assets/1b425011-ae36-4b54-bb75-fc193a3246ba

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

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

はじめの一歩

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

調査の方向性

TypeScript サーバーの outline モデルから始め、issue にある 2 つのコード例を再現し、分割代入された戻り値に対して生成されるエントリと、名前付き変数に対して生成されるエントリを比較します。分割代入の場合にネストされた a、b、c のエントリが省略される理由を追跡し、両方の形式でこれらのエントリが一貫して公開されるようになった時点で issue の対応完了とします。

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

評価

技術スタック
typescript
領域
devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

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

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