-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
"Move to file" doesn't seem to behave correctly for overloads
Given a function like
function add(x: number, y: number): number;
function add(x: string, y: string): string;
function add(x: any, y: any) {
return x + y;
}
if you right click any of them and use this refactor, it will only move that part
Code_-_Insiders_pnskO6qwK9.mp4
Edit: I discovered it works correctly if you highlight all the functions and then use the refactor on the selection. But it would probably be better and more intuitive to properly handle overloads even if you don't? It works correctly for jsdoc at least, so I would expect it to also work for overloads
The old "Move to a new file" also seems affected by this
Originally posted by @Vendicated in #53542 (comment)
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this