microsoft / microsoft/TypeScript

Duplicate imports when using "Update Imports On Paste"

Đang mở
#62,141 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@navya9singh đang làm issue này rồi.

Từ ngày 28/7/2025.

Needs Investigation
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ả

Does this issue occur when all extensions are disabled?: Yes

Version: 1.103.0-insider (Universal)
Commit: d8361fecca3b53536de8f7a949b107fb7451e5e6
Date: 2025-07-25T05:03:31.984Z
Electron: 37.2.3
ElectronBuildId: 11993778
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Darwin arm64 24.5.0

(Happens both in insider and in latest stable version)

About the issue
  • When you copy code that relay on symbols that already exits in the target file - you will have duplicate imports.
  • When you copy code to a comment it will also copy the imports.
Steps to Reproduce

Copy code that relay on import to another file that already has this import.

https://github.com/user-attachments/assets/8a2df326-a40f-41fb-93dc-cecedea283f7

Check out this repo for easy reproduce:
https://github.com/ido-pluto/vscode-copy-with-import-issue/tree/main

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.