microsoft / microsoft/TypeScript

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

Aperta
#61,712 1 commento 2 reazioni 1 assegnatario Vedi su GitHub

@joj ci sta già lavorando.

Dal 16/5/2025.

Needs Investigation Visual Studio
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

🔍 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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.