Can I propagate XML documentation from an interface to its implementation?

喜欢而已 提交于 2019-11-28 07:04:27

问题


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?


回答1:


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".




回答2:


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.

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



来源:https://stackoverflow.com/questions/6042597/can-i-propagate-xml-documentation-from-an-interface-to-its-implementation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!