如何编写显示在Intellisense中的C ++注释? [英] How to write C++ comments that show up in Intellisense?

查看:297
本文介绍了如何编写显示在Intellisense中的C ++注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2010 Ultimate在C ++编程。我想要记录一些功能,我想要在Intellisense中显示文档。



根据 MSDN ,我只需要在声明之前或在同一行之后放置评论。所以我试过这个:

  //这是一个测试。 
void foo();
void bar(){foo();

将鼠标移到 foo(),该注释不会显示在工具提示中。我也试过:





我迄今没有运气。有没有人知道这样做的方法?

解决方案

现在支持VS 2012!



以前,注释中的XML标签只能被C ++ / CLI读入,而不是纯旧的C ++。
VS 2012现在至少将其中的一些转化为常规C ++ - 它位于Visual Studio 2012的新功能,MSDN文档中的XML文档(Visual C ++)



我已经在2012年的自己的应用程序中测试了,我可以确认摘要,para和seealso标签都被拉出,用于工具提示格式化。


I'm programming in C++ using Visual Studio 2010 Ultimate. I want to document some functions and I want the documentation to show up in Intellisense.

According to MSDN, I just need to put the comment before the declaration or after it on the same line. So I tried this:

// This is a test.
void foo();
void bar() { foo(); }

When moving my mouse over foo(), the comment doesn't appear in the tooltip. I also tried:

  • ///
  • <summary></summary> tags
  • Building with /doc (by setting the "Generate XML documentation files" option in the project settings)

I've had no luck so far. Does anyone know a way to make this work?

解决方案

This now supported in VS 2012!

Previously, XML tags in the comments were only read in by C++/CLI, not plain old C++. VS 2012 now brings at least some of this into regular C++ - it is in the "What's New in Visual Studio 2012" and in the MSDN docs as "XML Documentation (Visual C++)" under "".

I've tested it with my own application in 2012 ultimate, and I can confirm that the summary, para, and seealso tags are all pulled out an formatted for tooltips.

这篇关于如何编写显示在Intellisense中的C ++注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆