You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <remarks>/// Pattern:<br/>/// (elided as details are not relevant)/// </remarks>[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator","8.0.11.1707")]publicstaticpartialglobal::System.Text.RegularExpressions.RegexMyRegex()=>global::System.Text.RegularExpressions.Generated.MyRegex_14.Instance;
As a result, it is in practice not possible to add custom XML documentation to the original partial method declaration, as Visual Studio will only use one set of XML documentation (and it appears that it seems to reliably prefer the generated docs).
I think there are two options to allow custom XML documentation to be added:
When processing the GeneratedRegexAttribute, pick up any XML documentation declared and merge it with the auto-generated documentation when emitting the generated code. If the user does not declare a <remarks> or <inheritdoc> section, then merging should be straightforward; however, some thought as to best behaviour if either section is declared is probably needed.
As an alternative, if the user does have XML documentation, do not emit any auto-generated documentation to ensure Visual Studio picks up the user's version.
Allow a new boolean argument on GeneratedRegexAttribute to disable the auto-generated documentation. I think this is strictly worse than the first option, so would only suggest it if it is not possible for whatever reason to detect if the user has added any XML documentation.
The text was updated successfully, but these errors were encountered:
If you use a source-generated Regex, e.g.
a
<remarks>
section is automatically emitted by the RegexGenerator, e.g.As a result, it is in practice not possible to add custom XML documentation to the original partial method declaration, as Visual Studio will only use one set of XML documentation (and it appears that it seems to reliably prefer the generated docs).
I think there are two options to allow custom XML documentation to be added:
When processing the
GeneratedRegexAttribute
, pick up any XML documentation declared and merge it with the auto-generated documentation when emitting the generated code. If the user does not declare a<remarks>
or<inheritdoc>
section, then merging should be straightforward; however, some thought as to best behaviour if either section is declared is probably needed.Allow a new boolean argument on
GeneratedRegexAttribute
to disable the auto-generated documentation. I think this is strictly worse than the first option, so would only suggest it if it is not possible for whatever reason to detect if the user has added any XML documentation.The text was updated successfully, but these errors were encountered: