Is there anything like GhostDoc for C++

﹥>﹥吖頭↗ 提交于 2019-12-30 03:20:08

问题


When I'm developing in C#, I heavily use GhostDoc to speed up the process of commenting my code. I'm currently working on a C++ project and I haven't found an equivalent tool. I know about Doxygen, but from what I know it is used to create documentation outside the code, not comments in the code. Are there any good equivalent tools? I would prefer one that runs in VS, but I could handle one that works in any IDE.

(Before someone brings it up, I don't rely solely on GhostDoc to create comments. I just use it to create the starting point for my comments.)


回答1:


Visual Assist helps by providing custom scripts executed while typing (or on other).

For example, you can have a script for comments like this :

/************************************************************************/
/* My comment : $end$                                                                     */
/************************************************************************/

That would be suggested (via a combo-box exactly like intellisense) when you start typing "/**" for example. When you select this suggestion (via Enter/Space/Click - customizable), it will insert the script where your cursor is and just replace markers that are between '$' characters by special values (like the current file name for example). Here the $end$ marker will make the cursor be at this position when the script is executed. This way, you continue typing smoothly. For example with the previous script set, typing exactly :

/** this is a test comment to show you one of the many features Visual Assit!

will simply give :

/************************************************************************/
/* My comment : this is a test comment to show you one of the many features Visual Assit!                                                                     */
/************************************************************************/

It's really easy to customize and the behavior of the suggestion (read : intellisense++) system is customizable.




回答2:


I've written an add-in, Atomineer Pro Documentation, which is very similar to GhostDoc (it generates/updates documentation comments to save a lot of time and effort when documenting), but it parses the code directly for itself and thus is able to handle C, C++, C++/CLI, C#, Java and Visual Basic code, and doesn't require the surrounding code to be in a compiling state before it will work. It will also automatically add/update documentation for more tricky things such as exceptions thrown within the body of a method.

It runs under Visual Studio 11, 2010, 2008 and 2005, and supports Documentation-Xml, Doxygen, JavaDoc and Qt commenting formats, as well as the format/style of comment blocks and the auto-doc rules used being highly configurable. It has a number of other handy features such as aiding conversions of legacy doc-comments to the above formats, and word wrapping in doc-comments and normal block comments.

The above is just a summary of some key features - This comparison of features with other products serves as a more complete list of the many other features available.




回答3:


Visual Assist might do the job, though I'm not absolutely sure.



来源:https://stackoverflow.com/questions/532779/is-there-anything-like-ghostdoc-for-c

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