microsoft / microsoft/TypeScript
Destructured function does not show outline of inner function parameters
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 132
Mô tả
🔎 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
// 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với mô hình outline của máy chủ TypeScript và tái hiện hai ví dụ mã từ issue, so sánh các mục được tạo cho giá trị trả về được phân rã với các mục được tạo cho một biến có tên. Truy nguyên lý do các mục lồng nhau a, b và c bị bỏ qua trong trường hợp phân rã, và coi issue là hoàn tất khi cả hai dạng đều hiển thị các mục đó một cách nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100