Is there any Visual Studio Add-In that can do the remove method refactoring?
Suppose you have the following method:
Result DoSomething(parameters)
{
return ComputeResult(parameters);
}
Or the variant where Result is void.
The purpose of the refactoring is to replace all the calls to DoSomething with calls to ComputeResult or the expression that uses the parameters if ComputeResult is not a method call.
Press Ctrl+Shift+R and then choose Safe Delete. Right-click and choose Refactor | Safe Delete from the context menu.
If you'd just like to see refactorings without Quick Fixes, you can use the Refactor command (Ctrl+Shift+R). Note: If you prefer to not see the Code Action lightbulb in your editor, you can disable lightbulbs with the editor.
If I understand the question, then Resharper calls this 'inline method' - Ctrl - R + I
I would do it the simpliest way:
Maybe VS will show some conflict because of the last rename, but ignore it.
By "rename" I mean: overwrite the name of the method and after it use the dropdown (Shift+Alt+F10) and select "rename". It will replace all occurences with the new name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With