我可以将 XML 文档从接口传播到其实现吗?
我需要将 XML 文档从基类传播到派生类或从接口传播到实现。
我可以使用 Resharper 执行此操作吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,你可以。
如果您尚未实现/重写成员,则在派生类或接口实现中,单击 Alt+Ins,选择“重写成员”或“实现缺失的成员” 。在随后显示的向导中,选择要实现/覆盖的成员,并确保选择“复制 XML 文档”。
或者,如果您已经有覆盖或实现的成员,请在覆盖/实现的成员上按 Alt+Enter,然后选择“从库复制评论”。
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".
从 2016.2 EAP 9 开始,ReSharper 支持
标签 (RSRP-33352)。您将使用 QuickDoc 查看累积的文档(默认为 Ctrl+Shift+F1)。成员生成选项页面已通过另一个选项进行扩展,以自动将该标签添加到任何生成的成员。您还将对尚未有文档的成员执行上下文操作。
我还可以推荐 XmlDoc Inspections 插件,这在某种程度上与主题相关。
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.