Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bgen] Generate xml documentation for the extension class we generate for protocols. #20564

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/bgen/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4888,6 +4888,12 @@ void GenerateProtocolTypes (Type type, string class_visibility, string TypeName,
include_extensions = optionalInstanceMethods.Any () || optionalInstanceProperties.Any () || requiredInstanceAsyncMethods.Any ();
if (include_extensions) {
// extension methods
if (BindingTouch.SupportsXmlDocumentation) {
print ($"/// <summary>Extension methods to the <see cref=\"I{TypeName}\" /> interface to support all the methods from the {protocol_name} protocol.</summary>");
print ($"/// <remarks>");
print ($"/// <para>The extension methods for <see cref=\"I{TypeName}\" /> interface allow developers to treat instances of the interface as having all the optional methods of the original {protocol_name} protocol. Since the interface only contains the required members, these extension methods allow developers to call the optional members of the protocol.</para>");
print ($"/// </remarks>");
}
PrintAttributes (type, preserve: true, advice: true);
print ("{1} unsafe static partial class {0}_Extensions {{", TypeName, class_visibility);
indent++;
Expand Down
Loading