microsoft / microsoft/TypeScript
Destructured function does not show outline of inner function parameters
还没有人认领这个 Issue。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 TypeScript 服务器的 outline 模型开始,重现 issue 中的两个代码示例,并比较为解构返回值生成的条目与为命名变量生成的条目。追踪为什么在解构情况下会省略嵌套的 a、b 和 c 条目,并在两种形式都一致地公开这些条目时认为 issue 已完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100