microsoft / microsoft/TypeScript

Duplicate imports when using "Update Imports On Paste"

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

@navya9singh がすでに取り組んでいます。

2025年7月28日 から。

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

説明

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

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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