Refactor: Give parameter default and delegate

I noticed that you can add a parameter with "change signature" with a default value. For example we can go from "void method()" to "void method( int param1 )" and keep the old signature as a delegation with default. However, is it possible to go the other way? I can't figure out how to do it. If it is not possible, I think it is an interesting feature idea for the EAP.

For example, if I have code "void method( int param1 )" I want to construct a method: "void method() { method( 5 ); }" for example. It could just be an extension to the change signature dialog to allow one to put default values for parameters already existing, or even faster you could have an intention when on a parameter to "set default value" which would do a "live template" style where it makes the delegation but puts the value as a call, for example "void method( int a, int b ) { method( a, b, ); }" where the user has used the intention on the 3rd parameter, the live template is invoked and waiting for user to insert a value into the 3rd slot.

0

请先登录再写评论。