When refactor->renaming MyMethod in the following example in Visual C# 2010 Express, the method name ‘MyMethod’ in the comment won’t be changed.
Usually that a comment isn’t touched by refactor/rename is for good reasons, since how should the IDE know that it’s not just some word but actually references the very method that it is refactoring.
So is there a way in which a word in a comment can be bound to a class/method/variable name within Visual C# 2010 Express, so that it’s changed as well during refactoring/renaming?
If there are several ways what would be the easiest/cheapest way?
(cheapest – in case of plugins or commercial versions)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
/// text for class MyClass
public class MyClass
{
/// <summary><c>MyMethod</c> is a method in the <c>MyClass</c> class.
/// </summary>
public static void MyMethod(int Int1)
{
}
/// text for Main
public static void Main()
{
Console.ReadLine();
}
}
}
At least in the commercial editions, the rename dialog (press F2) has an
Search in Commentscheckbox.