Cloning comments with GhostDoc \ AtomineerUtils is certainly working approach, but it has significant disadvantages, e.g.:
When the original comment is changed (which frequently happens during development), its clone is not.
You're producing huge amount of duplicates. If you're using any source code analysis tools (e.g. Duplicate Finder in Team City), it will find mainly your comments.
As it was mentioned, there is <inheritdoc> tag in Sandcastle, but it has few disadvantages in comparison to FiXml:
Sandcastle produces compiled HTML help files - it doesn't modify .xml files containing extracted XML comments. But these files are used by many tools, including .NET Reflector and class browser \ IntelliSense in Visual Studio .NET. So if you use just Sandcastle, you won't see inherited documentation there.
Sandcastle's implementation is less powerful. E.g. the is no <see ... copy="true" />.
Short description of FiXml: it is a post-processor of XML documentation produced by C# \ Visual Basic .Net. It is implemented as MSBuild task, so it's quite easy to integrate it to any project. It addresses few annoying cases related to writing XML documentation in these languages:
No support for inheriting the documentation from base class or interface. I.e. a documentation for any overridden member should be written from scratch, although normally it’s quite desirable to inherit at least the part of it.
No support for insertion of commonly used documentation templates, such as “This type is singleton - use its <see cref="Instance" /> property to get the only instance of it.”, or even “Initializes a new instance of <CurrentType> class.”
To solve mentioned issues, the following additional XML tags are provided:
<inheritdoc />, <inherited /> tags
<see cref="..." copy="..." /> attribute in <see/> tag.
There seems to not be any support for such autodocumentation in Sandcastle. The Sandcastle Help File Builder though implements a custom inheritdoc tag.
From the SHFB site:
Support is included for the <inheritdoc /> tag which allows you to inherit documentation from base types/members. This is implemented via a standalone tool so it can also be used by other third-party tools and build scripts. This tool provides features beyond those found in the build component supplied with Sandcastle.
Second Update: according to this workitem, the Sandcastle "support" for inheritdoc is through the SHFB tool. Bottom line I suppose is, SHFB solves your problem.
A tool such as GhostDoc can generate the documentation on the implementing classes, when you use it's keyboard shortcut. That is not entirely automatic, but could help prevent too much copy pasting.
AtomineerUtils will auto-generate comments for you, and it picks up existing documentation from overloads and overridden base class, saving you loads of hassle in duplicating the information where it's needed.
发布评论
评论(4)
我有一个更好的答案:FiXml。
使用 GhostDoc \ AtomineerUtils 克隆注释当然是可行的方法,但它有明显的缺点,例如:
它的克隆不是。
源代码分析工具(例如 Team City 中的 Duplicate Finder),它将
主要查找您的评论。
正如前面提到的,Sandcastle< 中有
标记/a>,但与 FiXml 相比,它有一些缺点:.xml
文件包含提取的 XML 注释。 但这些文件被许多工具使用,
包括 Visual Studio .NET 中的 .NET Reflector 和类浏览器 \ IntelliSense。
因此,如果您只使用 Sandcastle,您将不会在那里看到继承的文档。
<参见...copy="true"/>
。请参阅 Sandcastle 的
描述 了解更多详细信息。FiXml简介:它是由C#\Visual Basic .Net生成的XML文档的后处理器。 它作为 MSBuild 任务实现,因此很容易将其集成到任何项目中。 它解决了与用这些语言编写 XML 文档相关的一些恼人的情况:
属性来获取唯一的它的实例。”,甚至“初始化
类的新实例。”为了解决上述问题,提供了以下附加 XML 标记:
、
标记<
标记中的/> 属性。这是其网页和下载页面。
I have a better answer: FiXml.
Cloning comments with GhostDoc \ AtomineerUtils is certainly working approach, but it has significant disadvantages, e.g.:
its clone is not.
source code analysis tools (e.g. Duplicate Finder in Team City), it will
find mainly your comments.
As it was mentioned, there is
<inheritdoc>
tag in Sandcastle, but it has few disadvantages in comparison to FiXml:.xml
filescontaining extracted XML comments. But these files are used by many tools,
including .NET Reflector and class browser \ IntelliSense in Visual Studio .NET.
So if you use just Sandcastle, you won't see inherited documentation there.
<see ... copy="true" />
.See Sandcastle's
<inheritdoc>
description for further details.Short description of FiXml: it is a post-processor of XML documentation produced by C# \ Visual Basic .Net. It is implemented as MSBuild task, so it's quite easy to integrate it to any project. It addresses few annoying cases related to writing XML documentation in these languages:
<see cref="Instance" />
property to get the only instance of it.”, or even “Initializes a new instance of<CurrentType>
class.”To solve mentioned issues, the following additional XML tags are provided:
<inheritdoc />, <inherited />
tags<see cref="..." copy="..." />
attribute in<see/>
tag.Here is its web page and download page.
Sandcastle 中似乎不支持此类自动文档。 Sandcastle 帮助文件生成器 不过实现了自定义的heritdoc 标记。
来自 SHFB 网站:
第二次更新:根据此工作项 ,Sandcastle 对inheritdoc 的“支持”是通过SHFB 工具实现的。 我认为最重要的是,SHFB 解决了您的问题。
There seems to not be any support for such autodocumentation in Sandcastle. The Sandcastle Help File Builder though implements a custom inheritdoc tag.
From the SHFB site:
Second Update: according to this workitem, the Sandcastle "support" for inheritdoc is through the SHFB tool. Bottom line I suppose is, SHFB solves your problem.
当您使用键盘时,诸如 GhostDoc 之类的工具可以生成有关实现类的文档捷径。 这并不是完全自动的,但可以帮助防止过多的复制粘贴。
也许它可以通过脚本自动化。
A tool such as GhostDoc can generate the documentation on the implementing classes, when you use it's keyboard shortcut. That is not entirely automatic, but could help prevent too much copy pasting.
Perhaps it could be automized with a script.
AtomineerUtils 将为您自动生成注释,并从重载和重写的基类中获取现有文档,从而为您节省在需要的地方复制信息的麻烦。
http://www.atomineer.com/AtomineerUtils.html
AtomineerUtils will auto-generate comments for you, and it picks up existing documentation from overloads and overridden base class, saving you loads of hassle in duplicating the information where it's needed.
http://www.atomineer.com/AtomineerUtils.html