codeformatter icon indicating copy to clipboard operation
codeformatter copied to clipboard

Rename fields referenced in comments

Open stephentoub opened this issue 10 years ago • 3 comments

Some code bases talk about field in comments. Currently when the code formatter renames a field, it doesn't update the comment.

stephentoub avatar Jan 10 '15 12:01 stephentoub

Do you mean via a <see cref="fieldName"/> or simply an unqualified name in the comment?

jaredpar avatar Jan 10 '15 16:01 jaredpar

Regular comment, not XML. I realize it's just regular text, but without fixing it up, the code formatter in a sense breaks the comments. See https://github.com/dotnet/corefx/pull/390 for a bunch of examples.

stephentoub avatar Jan 10 '15 16:01 stephentoub

I agree that we should do this but the change does have the potential to do incorrect edits in the code. Refactor Rename in the IDE approaches this by making it an option in a rename operation. I think we should do the same here.

jaredpar avatar Jan 10 '15 17:01 jaredpar