如何获得完整的intellisense工具提示评论工作? [英] How to get full intellisense tooltip comments working?

查看:136
本文介绍了如何获得完整的intellisense工具提示评论工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些C ++ / CLI软件,这是所有好的,并记录在一个C#的ish这种方式,这意味着DOxygen能够拉出一些不错的html。有什么办法我可以得到相同的信息出现在intellisense工具提示的.NET框架的方式吗?



例如,让我们说这是我的标题文件(MyApp.h):

  / *************** MyApp.h *************** / 

///我的命名空间包含所有我的时髦类class
namespace MyNamespace
{
using命名空间系统;

ref class WorldHunger;

///一个真正的解决所有世界问题的类。
public ref class MyClass
{
public:
///构造一个MyClass
MyClass()
{

}


///< summary>尝试修复世界饥饿< / summary>
///< param name =problem>尝试修复的问题< / param>
///< return>无论问题是否解决< / param>
bool FixWorldHunger(WorldHunger ^ problem);
};
}

...这是相应的实现:

  / *************** MyApp.cpp ************** * / 

#includeMyApp.h

使用命名空间MyNamespace;

MyClass :: MyClass()
{

}

bool MyClass :: FixWorldHunger(WorldHunger ^ problem)
{
bool result = false;

/// TODO:实现聪明的东西

return result;
}

下面是输入时intellisense对内置函数的作用:



当我输入时,intellisense对我自己的函数有什么作用:



当然有办法吗?

 只要总结一下,为了这个工作,你需要你的注释兼容的形式: ///< summary> 
///在指定的索引处检索窗口小部件
///< / summary>
///< param name =widgetIndex>要检索的窗口小部件的索引。< / param>
///< return>指定索引处的窗口小部件< / returns>
小部件* GetWidget(int widgetIndex);

然后你只需右键单击Visual Studio中的项目,然后转到属性>配置属性> C / C ++>输出文件并更改生成XML文档文件



当您重建项目广告并将其导入其他地方时,您应该会看到完整记录的工具提示。


I've got some C++/CLI software which is all nice and documented in a C#'ish kind of way which means DOxygen is able to pull it out into some nice html. Is there any way I can get that same information to appear in the intellisense tool tips the way that the .net framework does?

For example, lets say this is my header file (MyApp.h):

    /*************** MyApp.h ***************/

    /// My namespace containing all my funky classes
    namespace MyNamespace
    {
            using namespace System;

            ref class WorldHunger;

            /// A truly elegent class which solves all the worlds problems
            public ref class MyClass
            {
            public:
                    /// Constructs a MyClass
                    MyClass()
                    {

                    }


                    /// <summary>Attempts to fix world hunger</summary>
                    /// <param name="problem">The problem to try and fix</param>
                    /// <returns>Whether or not the problem was solved</param>
                    bool FixWorldHunger( WorldHunger^ problem );
            };
    }

...and this it's corresponding implementation:

    /*************** MyApp.cpp ***************/

    #include "MyApp.h"

    using namespace MyNamespace;

    MyClass::MyClass()
    {

    }

    bool MyClass::FixWorldHunger( WorldHunger^ problem )
    {
            bool result = false;

            /// TODO: implement something clever

            return result;
    }

Here's what intellisense does for built in functions when I'm typing:

Here's what intellisense does for my own functions when I type:

Surely there's a way to do this?

解决方案

Just to summarise, for this to work you need your comments in a compatible form:

/// <summary>
/// Retrieves the widget at the specified index
/// </summary>
/// <param name="widgetIndex">Index of the widget to retrieve.</param>
/// <returns>The widget at the specified index</returns>
Widget* GetWidget(int widgetIndex);

Then you simply right-click on the project in Visual Studio and go to properties > configuration properties > C/C++ > Output Files and change Generate XML Documentation Files to Yes.

When you rebuild your project ad import it somewhere else, you should see fully documented tooltips appear.

这篇关于如何获得完整的intellisense工具提示评论工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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