Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Resharper Copy XML Comments from Base Class

Tags:

resharper

I have a class that i am inheriting from and the methods i override should have the same comments as the base. Does resharper have an option to copy them?

like image 487
Ryan Burnham Avatar asked Aug 25 '11 06:08

Ryan Burnham


3 Answers

In addition to the above mentioned context action, which I find fairly tedious to apply for each inherited member, you can also configure ReSharper to "pull down" comments by default when implementing a base class or interface.

To do this, from the ReSharper main menu go to Options | Code Editing | Member Generation | Other Options inside here you will see an option to Copy XML documentation from overridden members, if you check this option ReSharper will automatically copy all inherited documentation for you.

enter image description here

like image 64
Richard Avatar answered Oct 21 '22 03:10

Richard


Since version 3.0 of ReSharper, you should have a context action available to do this, Copy comments from base. If it doesn't appear to be available, make sure it's checked in ReSharper | Options | Languages | C# | Context Actions.

like image 36
AakashM Avatar answered Oct 21 '22 05:10

AakashM


Let your overridden methods uncommented. So R# short help (Ctrl+Shift+F1) will automatically show the help of base class member.

like image 25
brgerner Avatar answered Oct 21 '22 03:10

brgerner