Push/Pull Parameters is a complex tool that helps simplify the process of changing method signatures.
This tool is automatically launched when:
- you add a new argument to a method call or remove an existing one from it, and apply the corresponding quick-fix to update the signature of the method
- you change the signature of a method using the Change Signature refactoring
ReSharper reanalyzes the code as you type and suggests adding parameters according to the changes.
You can easily find it out due to red highlighting
and red bulb placed on the left gutter.
Show method is called with two parameters, but
it is declared with one only.
You can apply the corresponding quick-fix to change the method signature,
but it's not enough in case the method is called multiple times or has inheritance hierarchy, etc.
In order not to break the compilation or miss some source structures that must be changed, ReSharper gathers and displays all necessary data in the window.
As you can see, there is one more method call. After modifying the method signature, it's not appropriate to leave this method call with one argument. So, look through the list of available actions and select the action that fits your goals best. Depending on your choice, ReSharper either completes all changes immediately or suggests to modify other methods.
This feature is supported in the following languages/technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.