Open DickvdBrink opened 10 years ago
Please reopen this issue, #13080 marked duplicated and closed and this one marked closed because linked to the duplicated item.
@wongchichong, this issue is still open ;)
You seem to be confusing the posting in this issues timeline of the other issue.
Yaya.... LOL..
Just came across this very need. Refactoring a method signature in a very large project where the amount of calls is in the 100's.
This refactoring would also be useful on function types.
type MyFunction = (foo: string, bar: number) => void;
function doSomething (fn: MyFunction): void {
fn('foo', 4);
}
doSomething((foo, bar) => foo + (2*bar));
// A reordering refactor on MyFunction would change all this to:
type MyFunction = (bar: number, foo: string) => void;
function doSomething (fn: MyFunction): void {
fn(4, 'foo');
}
doSomething((bar, foo) => foo + (2*bar));
Especially useful with generic type parameters
Is there any way I can vote for this issue? This would be a really convenient refactor feature.
I miss this feature often: Reordering parameters (of functions, methods, constructors) manually is painful and error-prone. Alas, it’s an important part of improving APIs.
I would really like something like reorder parameters as a refactoring option, like C# already has: http://msdn.microsoft.com/en-us/library/5ss5z206.aspx
edit: This might be a bit hard when the info comes from a .d.ts file, though.