VS 2017 c ++ - 如何让XML注释intellisense区分重载 [英] VS 2017 c++ - How to have XML comment intellisense differentiate between overloads

查看:51
本文介绍了VS 2017 c ++ - 如何让XML注释intellisense区分重载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近发现你可以在你在某个类中定义的函数上面编写xml注释,这些函数将为intellisense提供信息。  例如:



I recently discovered that you can write xml comments above your functions you've defined in some class that will give information for intellisense.  For example:

/// <summary> Create a FitsFile class object with an existing double 2-D array    
/// <para> Image data is maintained at double precision.</para></summary>    
/// <param name="FullFileName"> File name.</param>    
/// <param name="ImageData"> The data array to use for the FITS image data. </param>    
/// <param name="Do_Stats"> Optionally perform the statistics</param>	
FitsFile(String^ FullFileName, array<double,2>^ ImageData, bool Do_Stats);

然后当我在其他地方使用它,我得到了你所期望的intellisense。  但是这个构造函数有几个重载,其中一个很简单:



Then when I use that elsewhere, I get the intellisense as you would expect.  However this constructor has several overloads, one of which is simply:

/// <summary> Create a FitsFile class object with an existing double 1-D array    
/// <para> Image data is converted to a 2-D array with a single row, maintaining double precision.</para></summary>   
/// <param name="FullFileName"> File name.</param>    
/// <param name="ImageData"> The data array to use for the FITS image data. </param>    
/// <param name="Do_Stats"> Optionally perform the statistics</param>    
FitsFile(String^ FullFileName, array<double>^ ImageData, bool Do_Stats);

这里唯一的区别是2-D和1-D数组。



无论如何,intellisense似乎无法区分这两种情况,我只得到智能感知对于在上面的代码中编写的第二个重载,它实际上是在intellisense对重载进行排序的第一次重载之前显示的。



任何想法如何获得intellisense到明确区分超载?  还需要其他一些XML代码等吗?
$


The only difference here being the 2-D vs 1-D array.

In any case, the intellisense doesn't seem able to distinguish the two cases, and I only get the intellisense for the 2nd overload written in code as above, which actually shows up before the 1st overload in the way the intellisense sorts the overloads.

Any ideas how to get intellisense to clearly distinguish between overloads?  Some other XML code required etc?

推荐答案

当您键入«FitsFile f("a",»,IntelliSense显示其中一个变体时,您可以单击工具提示或按箭头查看其他重载;所以它似乎适用于这些情况。如何重现问题?

When you type «FitsFile f("a",», IntelliSense displays one of the variants, then you can click the tooltip or press the arrow to view the other overloads; so it seems to work in these circumstances. How to reproduce the problem?


这篇关于VS 2017 c ++ - 如何让XML注释intellisense区分重载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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