15

I need to propagate XML documentation from a base class to derivative(s) or from an interface to implementation(s).

Can I do this using Resharper?

Tim M.
  • 53,671
  • 14
  • 120
  • 163
void
  • 1,347
  • 2
  • 13
  • 25

2 Answers2

20

Yes you can.

If you're yet to implement/override members, then in a derived class or interface implementation, click Alt+Ins, choose "Overriding members" or "Implement missing members". In the wizard that displays afterwards, choose members to implement/override, and make sure to select "Copy XML documentation".

Alternatively, if you already have an overridden or implemented member in place, press Alt+Enter on the overridden/implemented member, and select "Copy comments from base".

AakashM
  • 62,551
  • 17
  • 151
  • 186
Jura Gorohovsky
  • 9,886
  • 40
  • 46
  • Wouldn't this requires me to update all documentation on all implementing methods if I update the interface documentation? Isn't there a better way to do this? – Mikkel R. Lund Feb 09 '16 at 08:13
  • This would indeed require updating documentation on all implementing members but isn't that what you're looking for when you choose to maintain implementation-specific documentation? – Jura Gorohovsky Feb 12 '16 at 14:45
1

Starting from 2016.2 EAP 9, ReSharper supports the <inheritdoc /> tag (RSRP-33352). You will see the accumulated documentation using QuickDoc (default on Ctrl+Shift+F1).

The Members Generation option page has been extended by another option to automatically add that tag to any generated member. You will also have a context action on members, which don't have a documentation yet.

enter image description here

I can also recommend the XmlDoc Inspections plugin, which is somehow related to the topic.

Matthias
  • 15,919
  • 5
  • 39
  • 84