Get Visual Studio 2015 to recognize Doxygen comments - visual-studio

I have a function documented like this:
/**
* Does something useful
*/
int foo(Bar bar)
{
// my function
}
But Intellisense doesn't display it when i hover the function in other places. When i hover it at the definition, i see * Does something useful, which isn't right either (the star should not be in there). Doxygen runs fine and eclipse CDT displays the doc comments as you would expect.

As of version 2016.2, JetBrains ReSharper provides support for Doxygen documents in C++ files. From this blog post I quote:
Doxygen is arguably the most popular format and tool for code
documentation in the C++ world. ReSharper C++ now understands Doxygen
syntax, and provides several key features to facilitate editing of
documentation blocks.
Typing assist helps with creating new comment blocks and maintaining the
structure of existing ones.
Code completion suggests Doxygen commands with accompanying short descriptions.
Function parameter references introduced with \param commands will be reported by Find Usages and will get updated when Rename is used to change a function parameter’s name.
Warnings are issued when function parameter references do not resolve to an existing function parameter.
Documentation generation: You can now generate documentation for C++ declarators, classes and macro definitions.
Quick Documentation: Documentation now works in C++. The documentation pop-up (bound to Ctrl+Shift+F1 in the Visual Studio scheme or Ctrl+Q in the IntelliJ IDEA scheme) will display documentation from Doxygen comment blocks, or the symbol’s signature if no documentation is found.
It should be noted that this product is not free and to use it, you need to procure a license.

Related

XML Documentation Comments in VS Code?

In Visual Studio (C#/VB.NET, not sure in other languages?), if you add three slashes at the top of a method or property, Visual Studio auto-creates a structured way giving information for the method and its parameters and return values, where applicable. It's useful for creating developer documentation, but mostly I use it to reference information about a method I'm calling if, for example, I have multiple overloads and need to see which one I'm calling. See MS docs link here.
Does VS Code have anything like that? I can't seem to find it in the key bindings in preferences. Maybe there's something similar in VS Code that I'm not aware of?
Solved. Single line comments don't produce the XML documentation but the following syntax does:
/**
* include a description of your method to be viewed when you mouse over the method call
*/

how do I create readable C++/CX document from XML generated by Visual Studio 2015

My project is written in C++/CX on VS2015 and I am seeking a way to generate API documentation.
After googling and stackoverflow, I have tried doxygen, VSDocman,NDoc, Atomineer Pro Documentation and SandCastle, I found these tools do not support C++/CX syntax, therefore, they cannot generate correct document.
I also tried to generate XML file which VS supports. But it's hard to read XML file.
How do I generate API documentation from C++/CX? Thanks for any suggestion
There are a lot of misconceptions about the C++/CX language extension. You tried too many products that have no hope of getting you anywhere. First and foremost is that it is a native C++ extension and does not generate a .NET compatible assembly. So knock out any that try to use Reflection to parse metadata. Out goes NDoc, VSDocman, Sandcastle. Atomineer is out, it is just an editor add-in.
So all you got left is doxygen.
Sure, it doesn't know about C++/CX out of the box. The FAQ points out that in order to make it compatible with a language, you need to modify src/scanner.l
Having a look at it, I see it already supports the C++/CLI extension. That's another C++ language extension that supports generating MSIL. C++/CX syntax is very close to C++/CLI. Just some minor differences, like the gcnew keyword is too misleading and replaced by ref new. But that's not the kind of syntax that doxygen cares about, it just wants to know about declarations. Those keywords are the same.
So the only obstacle I can guess at is that you just forgot to tell it about the language. It can't guess at it correctly from just the filename extension, .cpp and .h will get it to parse plain C++. Modify or add this line in the config file:
CPP_CLI_SUPPORT = YES
And tweak scanner.l if necessary.

Functions on property sheet macros (Visual Studio)

On Property sheet macro PlatformShortName inconsistent between Win32 and x64 versions I learned that when editing e.g. project properties, you can use functions on Visual Studio macros to modify their value like this:
$(PlatformShortName.Replace("amd", "x"))
The above works, but I wasn't able to find any hints regarding this feature in Microsoft's documentation. Can anyone give me a hint if there are any other functions in addition to Replace() available and where I can find a list or some documentation of it? For example I would like to have something that can change a value to all uppercase or lowercase.

Setting language for xml documentation

I have localized version of Visual Studio and in new solutions XML-documentation from Base Class Library is displayed in IntelliSense in my language. But when I open solutions downloaded from Internet, this documentation is displayed in English. How can I choose this language?
I looked over project and solution properties and but did not found such setting. Changing language of assembly does not affects this. Possibly IntelliSense language setting is stored in hidden .suo file, but is is in binary format.
Actually I need to change documentation language because I am using GhostDoc and it generates documentation for member overloads in current IntelliSense language while generating all other documentation in English. GhostDoc also does not have such setting.
A little late but the answer is:
There is no such setting.
GhostDoc searches for the documentation of the .NET assemblies which are referenced.
Therefore if an english dll is referrenced, the documentation is in english
It is even worse, existing comments for own written methods seem tobe from file code model of VS, base classes from their documentation.
So you can have the case that you try to "ghostcomment" a method and get english, and another one is displayed in spanish )...

Visual C++ browse information

I am trying to figure out what the browse information (.sbr files) is used for but find only references how to create it. So what is it for?
Thanks
Dima
Read here (Visual C++ Team Blog: IntelliSense History, Part 1)
Capturing information about a C or C++
program’s structure has been around
for a very long time in Microsoft’s
products. Preceding even Visual C++
1.0, the compiler supported generating program information through .SBR and
.BSC files. (Note: The compiler in
Visual C++ 1.0 was already version 8,
so the command line tools had been
around a while already.) The SBR
files contain reference and definition
information for a single translation
unit that the compiler generates as it
compiles. These SBR files are
combined in a later step using the
BSCMAKE tool to generate a BSC file.
This file can then be used to look at
many different aspects of a program:
reference, definitions, caller-callee
graphs, macros, etc.
.sbr is pretty much Visual Studio's ctags - an index of symbols with backreferences to the source. When available, it's used by "Find Symbol" and other similar tools. It's more accurate than the built-in VS parser, because C++ can be tricky, and the real compiler can do a better job (though that is not quite true in VS2010 anymore).
At one time browse info drove the "Go to definition" engine, but that has been reworked in later version of Visual C++. Some third-party tools still use browse info (can't remember for sure, but I think one of Rational's tools does) to cross-reference code.
I always disable it, to shorten build times.

Resources