Visual Studio 2017, ReSharper 2017, C# project
I am trying to inherit the documentation of a method's parameter by using the select
attribute, but it doesn't seem to work as expected.
According to this article ( http://tunnelvisionlabs.github.io/SHFB/docs-master/SandcastleBuilder/html/79897974-ffc9-4b84-91a5-e50c66a0221d.htm ) documentation can be filtered using the select
attribute, and one of the examples show it being used as such:
/// <example>
/// <inheritdoc cref="MethodWithTwoExamples"
/// select="span[@id='Example 2']" />
/// </example>
So in a similar fashion I try to filter the documentation this way:
/// <param name="generateStream"><inheritdoc cref="MyClass.MyMethod" select="param[@name='generateStream']"/></param>
but the problem with it is that Visul Studio Intellisense doesn't display the documentation of that specific parameter, but instead it shows the documentation of the first parameter of the method I'm trying to inherit the documentation from.
So my question is: is it possible to filter documentation down to a specific parameter of a method?
The XML comments are used to build API documentation which is readable by external tools. IntelliSense also reads these, and uses the contents to show the docs for your code in the assistance tooltips as you type (and in the Documentation window).
It means "Inherit all the documentation and add more to it"
The cref attribute in an XML documentation tag means "code reference." It specifies that the inner text of the tag is a code element, such as a type, method, or property.
What you are asking for is possible with Visual Studio 2019 (16.9.3). I had the same problem myself and found a discussion here:
https://github.com/doxygen/doxygen/issues/7356/#issuecomment-547905295
which pointed me to the right direction.
First, as select
is deprecated, you have to use path
instead.
Second, you have to prefix the XPath part with a slash (/
) so that
your XML doc will look like this:
/// <param name="generateStream"><inheritdoc cref="MyClass.MyMethod" path="/param[@name='generateStream']"/></param>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With