microsoft / microsoft/TypeScript

Add option to remove "move to new file" quick fix

Open
#61,712 1 comment 2 reactions 1 assignee View on GitHub

@joj is already working on this.

Since May 16, 2025.

Needs Investigation Visual Studio
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔍 Search Terms

move to new file visual studio

✅ Viability Checklist
⭐ Suggestion

Add an option in VS/tsconfig/wherever to remove the "move to new file" quick fix.

📃 Motivating Example

Imagine you are using Visual Studio and writing some Typescript. You reference an item that is not yet imported. You press ctrl+. enter to import the item, but it turns out you forgot to export it. Now you have moved some random function/class/whatever to a new file and want to just put it back, but there's a number of problems.

  • There's no built-in way to undo this "quick" fix
  • The new files aren't added to the project as TypeScriptCompile in VS.
  • This also means that undoing it manually is a big pain because "Sync with active document" doesn't actually do that, leading to you deleting the wrong file.
  • Pasting the content back means the imports are now messed up. It's somewhat easy to make them work, but less easy to avoid a giant mess in git history.
💻 Use Cases

Set the option and be happy about losing less time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.