Skip to content
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
13 changes: 13 additions & 0 deletions src/bgen/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7140,12 +7140,18 @@ public void Generate (Type type)
continue;
async_result_types_emitted.Add (async_type.Item1);

if (BindingTouch.SupportsXmlDocumentation) {
print ($"/// <summary>This class holds the return values for an asynchronous operation.</summary>");
}
print ("public partial class {0} {{", async_type.Item1); indent++;

StringBuilder ctor = new StringBuilder ();

bool comma = false;
foreach (var pi in async_type.Item2) {
if (BindingTouch.SupportsXmlDocumentation) {
print ($"/// <summary>The result value from the asynchronous operation.</summary>");
}
var safe_name = pi.Name.GetSafeParamName ();
print ("public {0} {1} {{ get; set; }}",
TypeManager.FormatType (type, pi.ParameterType),
Expand All @@ -7159,6 +7165,13 @@ public void Generate (Type type)

print ("\npartial void Initialize ();");

if (BindingTouch.SupportsXmlDocumentation) {
print ($"/// <summary>Creates a new instance of this class.</summary>");
foreach (var pi in async_type.Item2) {
var safe_name = pi.Name.GetSafeParamName ();
print ($"/// <param name=\"{safe_name}\">Result value from an asynchronous operation.</param>");
}
}
print ("\npublic {0} ({1}) {{", async_type.Item1, ctor); indent++;
foreach (var pi in async_type.Item2) {
var safe_name = pi.Name.GetSafeParamName ();
Expand Down
190 changes: 0 additions & 190 deletions tests/cecil-tests/Documentation.KnownFailures.txt

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions tests/generator/ExpectedXmlDocs.MacCatalyst.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@
Summary for T2.#ctor(String)
</summary>
</member>
<member name="M:XmlDocumentation.T1.AsyncMethod(System.Action{System.Int32,System.Int64,Foundation.NSError})">
<summary>
Summary for T1.AsyncMethod
</summary>
</member>
<member name="M:XmlDocumentation.T1.DoSomething(System.Action)">
<summary>Summary for T1.DoSomething</summary>
</member>
Expand Down Expand Up @@ -504,6 +509,20 @@
</example>
</remarks>
</member>
<member name="T:XmlDocumentation.AsyncMethodResultTypeName">
<summary>This class holds the return values for an asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg1">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg2">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="M:XmlDocumentation.AsyncMethodResultTypeName.#ctor(System.Int32,System.Int64)">
<summary>Creates a new instance of this class.</summary>
<param name="arg1">Result value from an asynchronous operation.</param>
<param name="arg2">Result value from an asynchronous operation.</param>
</member>
<member name="T:XmlDocumentation.TClass">
<summary>TClass</summary>
</member>
Expand Down
19 changes: 19 additions & 0 deletions tests/generator/ExpectedXmlDocs.iOS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@
Summary for T2.#ctor(String)
</summary>
</member>
<member name="M:XmlDocumentation.T1.AsyncMethod(System.Action{System.Int32,System.Int64,Foundation.NSError})">
<summary>
Summary for T1.AsyncMethod
</summary>
</member>
<member name="M:XmlDocumentation.T1.DoSomething(System.Action)">
<summary>Summary for T1.DoSomething</summary>
</member>
Expand Down Expand Up @@ -504,6 +509,20 @@
</example>
</remarks>
</member>
<member name="T:XmlDocumentation.AsyncMethodResultTypeName">
<summary>This class holds the return values for an asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg1">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg2">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="M:XmlDocumentation.AsyncMethodResultTypeName.#ctor(System.Int32,System.Int64)">
<summary>Creates a new instance of this class.</summary>
<param name="arg1">Result value from an asynchronous operation.</param>
<param name="arg2">Result value from an asynchronous operation.</param>
</member>
<member name="T:XmlDocumentation.TClass">
<summary>TClass</summary>
</member>
Expand Down
19 changes: 19 additions & 0 deletions tests/generator/ExpectedXmlDocs.macOS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@
Summary for T2.#ctor(String)
</summary>
</member>
<member name="M:XmlDocumentation.T1.AsyncMethod(System.Action{System.Int32,System.Int64,Foundation.NSError})">
<summary>
Summary for T1.AsyncMethod
</summary>
</member>
<member name="M:XmlDocumentation.T1.DoSomething(System.Action)">
<summary>Summary for T1.DoSomething</summary>
</member>
Expand Down Expand Up @@ -504,6 +509,20 @@
</example>
</remarks>
</member>
<member name="T:XmlDocumentation.AsyncMethodResultTypeName">
<summary>This class holds the return values for an asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg1">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg2">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="M:XmlDocumentation.AsyncMethodResultTypeName.#ctor(System.Int32,System.Int64)">
<summary>Creates a new instance of this class.</summary>
<param name="arg1">Result value from an asynchronous operation.</param>
<param name="arg2">Result value from an asynchronous operation.</param>
</member>
<member name="T:XmlDocumentation.TClass">
<summary>TClass</summary>
</member>
Expand Down
19 changes: 19 additions & 0 deletions tests/generator/ExpectedXmlDocs.tvOS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@
Summary for T2.#ctor(String)
</summary>
</member>
<member name="M:XmlDocumentation.T1.AsyncMethod(System.Action{System.Int32,System.Int64,Foundation.NSError})">
<summary>
Summary for T1.AsyncMethod
</summary>
</member>
<member name="M:XmlDocumentation.T1.DoSomething(System.Action)">
<summary>Summary for T1.DoSomething</summary>
</member>
Expand Down Expand Up @@ -504,6 +509,20 @@
</example>
</remarks>
</member>
<member name="T:XmlDocumentation.AsyncMethodResultTypeName">
<summary>This class holds the return values for an asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg1">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="P:XmlDocumentation.AsyncMethodResultTypeName.Arg2">
<summary>The result value from the asynchronous operation.</summary>
</member>
<member name="M:XmlDocumentation.AsyncMethodResultTypeName.#ctor(System.Int32,System.Int64)">
<summary>Creates a new instance of this class.</summary>
<param name="arg1">Result value from an asynchronous operation.</param>
<param name="arg2">Result value from an asynchronous operation.</param>
</member>
<member name="T:XmlDocumentation.TClass">
<summary>TClass</summary>
</member>
Expand Down
7 changes: 7 additions & 0 deletions tests/generator/tests/xmldocs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ interface T1 : P1 {
[Notification (typeof (TEventArgs))]
NSString TEventArgs { get; }

/// <summary>
/// Summary for T1.AsyncMethod
/// </summary>
[Async (ResultTypeName = "AsyncMethodResultTypeName")]
[Export ("asyncMethod")]
void AsyncMethod (Action<int, long, NSError> completionHandler);

/// <summary>Summary for T1.DoSomething</summary>
[Async (XmlDocs = """
<summary>Summary for async version of T1.DoSomething</summary>
Expand Down