<p>Is there any Visual Studio Add-In that can do the remove method refactoring?<br>
Suppose you have the following method:  </p>

<pre><code>Result DoSomething(parameters)  
{  
    return ComputeResult(parameters);  
}  
</code></pre>

<p>Or the variant where Result is void.</p>

<p>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.</p>

[{'answer_id': 8551, 'author': 'Lars Mæhlum', 'author_id': 960, 'author_profile': 'https://Stackoverflow.com/users/960', 'pm_score': 1, 'selected': False, 'text': '<p>When it comes to refactoring like that, try out <a href="http://www.jetbrains.com/resharper/index.html" rel="nofollow noreferrer">ReSharper</a>.  </p>\n\n<p>Just right click on the method name, click "Find usages", and refactor until it cannot find any references.</p>\n\n<p>And as dlamblin mentioned, the newest version of ReSharper has the possibility to inline a method. That should do just what you need.</p>\n'}, {'answer_id': 8561, 'author': 'Biri', 'author_id': 968, 'author_profile': 'https://Stackoverflow.com/users/968', 'pm_score': 1, 'selected': False, 'text': '<p>I would do it the simpliest way:</p>\n\n<ol>\n<li>rename ComputeResult method to ComputeResultX</li>\n<li>rename DoSomething method to ComputeResult</li>\n<li>remove DoSomething method (which is now ComputeResult)</li>\n<li>rename ComputeResultX method back to ComputeResult</li>\n</ol>\n\n<p>Maybe VS will show some conflict because of the last rename, but ignore it.</p>\n\n<p>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.</p>\n'}, {'answer_id': 8563, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 0, 'selected': False, 'text': '<p>You can also right click the method name and click "Find all References" in Visual Studio.</p>\n\n<p>I personally would just do a <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>H</kbd> to <code>Find &amp; Replace</code></p>\n'}, {'answer_id': 8568, 'author': 'dlamblin', 'author_id': 459, 'author_profile': 'https://Stackoverflow.com/users/459', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.jetbrains.com/resharper/features/code_refactoring.html" rel="nofollow noreferrer">ReSharper</a> is definitely the VS 2008 plug in to have for refactoring. However it does not do this form of refactoring in one step; you will have to Refactor->rename DoSomething to ComputeResult and ignore the conflict with the real ComputeResult. Then delete the definition which was DoSomething. It\'s almost one step.</p>\n\n<p>However maybe it can <a href="http://www.jetbrains.com/resharper/features/code_refactoring.html#Inline_Method" rel="nofollow noreferrer">do it one step</a>. If I read that correctly.</p>\n'}, {'answer_id': 8577, 'author': 'Wedge', 'author_id': 332, 'author_profile': 'https://Stackoverflow.com/users/332', 'pm_score': 1, 'selected': False, 'text': '<p>There are a few products available to add extra refactoring options to Visual Studio 2005 &amp; 2008, a few of the better ones are <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Refactoring/" rel="nofollow noreferrer">Refactor! Pro</a> and <a href="http://www.jetbrains.com/resharper/" rel="nofollow noreferrer">Resharper</a>.</p>\n\n<p>As far as remove method, there is a description in the canonical Refactoring book about how to do this incrementally.</p>\n\n<p>Personally, I follow a pattern something along these lines (assume that compiling and running unit tests occurs between each step):</p>\n\n<ol>\n<li>Create the new method</li>\n<li>Remove the body of the old method, change it to call the new method</li>\n<li>Search for all references to the old method (right click the method name and select "Find all Reference"), change them to calls to the new method</li>\n<li>Mark the old method as [Obsolete] (calls to it will now show up as warnings during the build)</li>\n<li>Delete the old method</li>\n</ol>\n'}, {'answer_id': 8580, 'author': 'Will Dean', 'author_id': 987, 'author_profile': 'https://Stackoverflow.com/users/987', 'pm_score': 4, 'selected': True, 'text': "<p>If I understand the question, then Resharper calls this 'inline method' - <kbd>Ctrl</kbd> - <kbd>R</kbd> + <kbd>I</kbd></p>\n"}]
['https://Stackoverflow.com/questions/8549', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1065/']