feedback
feedback copied to clipboard
Attributes are not shown on parameters
Describe the bug
It seems attributes are not displayed for parameters in method signatures of .Net methods that have them.
To Reproduce
-
Go to the API reference for
ArgumentNullException.ThrowIfNull
. -
Observe that the displayed method signature is:
public static void ThrowIfNull (object? argument, string? paramName = default);
Expected behavior
The actual signature of the method is:
public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
Notice the following differences:
- The
CallerArgumentExpression
attribute is missing. This attribute significantly affects how the method is called, so I think it's important for it to be shown. - The
NotNull
attribute is missing. This attribute observably affects the method, so I think it would be useful if it was also shown. - The default value is shown as
default
instead ofnull
. This is a cosmetic difference (both are technically correct), but I think that for reference types,null
is clearer thandefault
.
Thanks @svick. I agree we need this support and I've logged an internal work item to track the work.