13
votes

I want enchanted syntax coloring in comments for C++ language in Visual Studio 2010. For example, I have the following code:

/*!
      \sa testMeToo()
      \param a the first argument.
      \param s the second argument.
*/
int testMe(int a,const char *s);

In Visual Studio all \param, \sa and other Doxygen commands are not highlighted. Is it possible to add custom highlighting to Visual Studio?

As for me ideal syntax highlighting for such C++ comments is in Anjuta (GNU/Linux C++ IDE).

Thanks.

UPDATE

I wrote EnhancedCommentsCpp addon for Visual Studio 2010/2012 that highlights Doxygen commands:

http://visualstudiogallery.msdn.microsoft.com/11a30c1c-593b-4399-a702-f23a56dd8548

This is how it looks like: enter image description here

1
I hope you don't have that code -- it will legitimately generate complaints from doxygen that your documentation doesn't match the actual parameter names in the source code. Beyond that, "the first argument" is not what should be in your documentation.Ben Voigt
This is just non-accurate copy-past from Doxygen documentation. Thanks :)Jarlaxle
What type of highlighting do you want? I'm throwing together a sample/extension that does it, but some more information would be helpful.Noah Richards
Here you can see it: yfrog.com/3ddoxygenpJarlaxle
That looks sweet! Nicely done. If you haven't yet, you should put up a version on the Visual Studio Gallery so other people can use this, too.Noah Richards

1 Answers

3
votes

You can use Visual Studio Extensibility to add custom syntax highlighting. You'll have to check MSDN and the Visual Studio Extensibility SDK to find out how though.