Search code examples
c#visual-studioautomated-refactoring

Replace symbol reference in visual studio


Is there any way in the VS 13 to replace a symbol reference/function call? for example: I'd like to replace all foo.baa("something") by newMethod("something") (the arguments must be preserved).


Solution

  • If you change the method name at the declaration you will have the option to rename refactor all instances of it. If that's not an option, ctrl+shift+h and do a replace all across entire solution. If your argument names vary, you can use the regular expressions option in that find and replace tool like so:

    enter image description here