C++/CLI InteliSense from XML comments breaks with generics  
Author Message
Chuck the Code Monkey





PostPosted: Visual C++ General, C++/CLI InteliSense from XML comments breaks with generics Top

When creating C++/CLI classes to use in C# applications, the InteliSense information created from XML comments fails to appear for a method if any of the parameters to said method use generics.

Example:

Say I have the following C++/CLI class:

/// <summary>
/// Stuff about Class1
/// </summary>
public ref class Class1
{
public:
/// <summary>
/// Does value stuff in the first class
/// </summary>
/// <param name="a">The lone value parameter</param>
static void DoStuff1(int a) { return;}

/// <summary>
/// Does reference stuff in the first class
/// </summary>
/// <param name="a">The lone reference parameter</param>
static void DoStuff2(Object ^a) { return; }

/// <summary>
/// Does generic value stuff in the first class
/// </summary>
/// <param name="a">The lone value parameter with a generic</param>
static void DoStuff3(ArraySegment<int> ^a) { return; }

/// <summary>
/// Does generic reference stuff in the first class
/// <//summary>
/// <param name="a">The lone reference parameter with a generic</param>
static void DoStuff4(List<int> ^a) { return; }
};

When this class is used from with in C#, all the appropriate comments and descriptions show up in the IntelliSense for Class1.DoStuff1 and Class1.DoStuff2, but none of the information from the XML comments show up in IntelliSense for Class1.DoStuff3 or Class1.DoStuff4

I also tried enabling 'Validate InteliSense' in the XML Document Generator options in the C++ project configuration properties but the output window shows xdcmake not recognizing /validate as a valid option.

I am currently using Visual Studio 2005 Team System for Software Developers(SP1) on XP-x64




Visual C++10  
 
 
Boris Jabes





PostPosted: Visual C++ General, C++/CLI InteliSense from XML comments breaks with generics Top

Hi Chuck,

It looks like you've uncovered a bug. I just tried this on our end and I see the problem as well. You can mitigate this by opening up the XML file generated and removing the "`1" part of the comment. Oh and you have two slashes in your last <//summary>.

It turns out you also uncovered another bug, which is that we expose the /validate option, which itself is not valid! Please log these bugs on our feedback site: http://connect.microsoft.com

Thanks,



 
 
Chuck the Code Monkey





PostPosted: Visual C++ General, C++/CLI InteliSense from XML comments breaks with generics Top

The double slash in the closing <//summary> was simply a typo and the problem persists regardless as I'm sure you have noticed by now.

I did log this as a bug and was informed that it was not important enough to fix:

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=254759

I was quite disappointed as I feel this is not too uncommon of a scenario, especially considering that XML documentation and generics are both technologies being pushed rather firmly right now.