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

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

问题描述

我有一些C ++ / CLI软件,这些都很好,记录在一个C#'ish的方式,这意味着DOxygen能够把它拉出来一些很好的html。有没有什么方法可以得到相同的信息,以显示在智能感知工具中提示.net框架的方式?



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

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

///我包含所有我的funky类的命名空间
命名空间MyNamespace
{
使用命名空间系统;

ref class WorldHunger;

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

}


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

...这是相应的实现:

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

#includeMyApp.h

使用命名空间MyNamespace;

MyClass :: MyClass()
{

}

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

/// TODO:实现一些聪明的

返回结果;
}

以下是当我输入内容时内置函数的intellisense:
http:// www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense1.jpg



这是智能感知对于我自己的功能,当我键入:
http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense2.jpg



当然有办法这样做吗?

解决方案

只是总结一下,为了这个工作,你需要你以兼容形式发表评论:

  ///< summary> 
///在指定的索引
///< / summary>中检索窗口小部件。
///< param name =widgetIndex>要检索的小部件的索引。< / param>
///< returns>指定索引的小部件< / returns>
Widget * 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: http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense1.jpg

Here's what intellisense does for my own functions when I type: http://www.geekops.co.uk/photos/0000-00-02%20%28Forum%20images%29/BrokenIntellisense2.jpg

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.

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

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