Skip to content

Commit

Permalink
[bgen] Add support for copying xml documentation for enums fields. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Mar 19, 2024
1 parent d10cd5d commit f8f6fe8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/bgen/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void GenerateEnum (Type type)
// skip value__ field
if (f.IsSpecialName)
continue;
WriteDocumentation (f);
PrintPlatformAttributes (f);
PrintObsoleteAttributes (f);
print ("{0} = {1},", f.Name, f.GetRawConstantValue ());
Expand Down
11 changes: 0 additions & 11 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1269,12 +1269,6 @@ F:AppKit.NSCellType.Image
F:AppKit.NSCellType.Null
F:AppKit.NSCellType.Text
F:AppKit.NSCellType.value__
F:AppKit.NSCharacterCollection.AdobeCns1
F:AppKit.NSCharacterCollection.AdobeGb1
F:AppKit.NSCharacterCollection.AdobeJapan1
F:AppKit.NSCharacterCollection.AdobeJapan2
F:AppKit.NSCharacterCollection.AdobeKorea1
F:AppKit.NSCharacterCollection.IdentityMapping
F:AppKit.NSCharacterCollection.value__
F:AppKit.NSCloudKitSharingServiceOptions.AllowPrivate
F:AppKit.NSCloudKitSharingServiceOptions.AllowPublic
Expand Down Expand Up @@ -14723,7 +14717,6 @@ F:LocalAuthentication.LARightState.NotAuthorized
F:LocalAuthentication.LARightState.Unknown
F:LocalAuthentication.LARightState.value__
F:LocalAuthentication.LAStatus.AppCancel
F:LocalAuthentication.LAStatus.AuthenticationFailed
F:LocalAuthentication.LAStatus.BiometryDisconnected
F:LocalAuthentication.LAStatus.BiometryLockout
F:LocalAuthentication.LAStatus.BiometryNotAvailable
Expand All @@ -14732,11 +14725,7 @@ F:LocalAuthentication.LAStatus.BiometryNotPaired
F:LocalAuthentication.LAStatus.InvalidContext
F:LocalAuthentication.LAStatus.InvalidDimension
F:LocalAuthentication.LAStatus.NotInteractive
F:LocalAuthentication.LAStatus.PasscodeNotSet
F:LocalAuthentication.LAStatus.Success
F:LocalAuthentication.LAStatus.SystemCancel
F:LocalAuthentication.LAStatus.UserCancel
F:LocalAuthentication.LAStatus.UserFallback
F:LocalAuthentication.LAStatus.value__
F:LocalAuthentication.LAStatus.WatchNotAvailable
F:MailKit.MEComposeSessionErrorCode.Body
Expand Down
12 changes: 11 additions & 1 deletion tests/generator/BGenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ public void InternalDelegate ()
[Test]
public void XmlDocs ()
{
var bgen = BuildFile (Profile.iOS, "tests/xmldocs.cs");
var bgen = BuildFile (Profile.iOS, false, true, "tests/xmldocs.cs");
Assert.That (bgen.XmlDocumentation, Does.Exist);
var contents = File.ReadAllText (bgen.XmlDocumentation);
var expectedContents =
Expand All @@ -1447,6 +1447,16 @@ public void XmlDocs ()
<name>api0</name>
</assembly>
<members>
<member name=""T:XmlDocumentation.E1"">
<summary>
Summary for E1
</summary>
</member>
<member name=""F:XmlDocumentation.E1.Value1"">
<summary>
Summary for E1.Value1
</summary>
</member>
<member name=""T:XmlDocumentation.IP1"">
<summary>
Summary for P1
Expand Down
10 changes: 10 additions & 0 deletions tests/generator/tests/xmldocs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,14 @@ interface TG1<T, U>
[Export ("method2:")]
void TGMethod2 (TG1<T, U> value);
}

/// <summary>
/// Summary for E1
/// </summary>
public enum E1 {
/// <summary>
/// Summary for E1.Value1
/// </summary>
Value1,
}
}

8 comments on commit f8f6fe8

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.