microsoft / microsoft/TypeScript
Add option to remove "move to new file" quick fix
Offen
@joj arbeitet bereits daran.
Seit 16.5.2025.
Needs Investigation
Visual Studio
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔍 Search Terms
move to new file visual studio
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.