-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RGen] Add docs to the SmartEnum generated methods.
Add the documentation to the smart enum extension class and its methods.
- Loading branch information
1 parent
71c1fa8
commit c51ad86
Showing
9 changed files
with
214 additions
and
4 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/rgen/Microsoft.Macios.Generator/Emitters/Documentation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
namespace Microsoft.Macios.Generator.Emitters; | ||
|
||
/// <summary> | ||
/// Static class that holds all the documentation strings. This allows to make the code generator | ||
/// cleaner by removing the need to have the documentation strings in the code. | ||
/// </summary> | ||
public static class Documentation { | ||
|
||
/// <summary> | ||
/// Smart enum documentation. | ||
/// </summary> | ||
public static class SmartEnum { | ||
|
||
public static string ClassDocumentation (string name) => | ||
@$"/// <summary> | ||
/// Extension methods for the <see cref=""{name}"" /> enumeration. | ||
/// </summary>"; | ||
|
||
public static string GetConstant () => | ||
@"/// <summary> | ||
/// Retrieves the <see cref=""global::Foundation.NSString"" /> constant that describes <paramref name=""self"" />. | ||
/// </summary> | ||
/// <param name=""self"">The instance on which this method operates.</param>"; | ||
|
||
public static string GetValueNSString (string name) => | ||
@$"/// <summary> | ||
/// Retrieves the <see cref=""{name}"" /> value named by <paramref name=""constant"" />. | ||
/// </summary> | ||
/// <param name=""constant"">The name of the constant to retrieve.</param>"; | ||
|
||
public static string GetValueHandle (string name) => | ||
@$"/// <summary> | ||
/// Retrieves the <see cref=""{name}"" /> value represented by the backing field value in <paramref name=""handle"" />. | ||
/// </summary> | ||
/// <param name=""handle"">The native handle with the name of the constant to retrieve.</param>"; | ||
|
||
public static string ToConstantArray (string name) => | ||
@$"/// <summary> | ||
/// Converts an array of <see cref=""{name}"" /> enum values into an array of their corresponding constants. | ||
/// </summary> | ||
/// <param name=""values"">The array of enum values to convert.</param>"; | ||
|
||
public static string ToEnumArray (string _) => | ||
@"/// <summary> | ||
/// Converts an array of <see cref=""NSString"" /> values into an array of their corresponding enum values. | ||
/// </summary> | ||
/// <param name=""values"">The array if <see cref=""NSString"" /> values to convert.</param>"; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c51ad86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💻 [CI Build #c51ad86] Windows Integration Tests passed 💻
✅ All Windows Integration Tests passed.
Pipeline on Agent
Hash: c51ad863c8e5dc69250baaa720ad605abf98d017 [CI build]
c51ad86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ API diff for current PR / commit
.NET ( No breaking changes )
❗ API diff vs stable (Breaking changes)
.NET ( ❗ Breaking changes ❗ )
ℹ️ Generator diff
Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)
Pipeline on Agent
Hash: c51ad863c8e5dc69250baaa720ad605abf98d017 [CI build]
c51ad86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 [CI Build #c51ad86] Test results 🔥
Test results
❌ Tests failed on VSTS: test results
0 tests crashed, 3 tests failed, 109 tests passed.
Failures
❌ cecil tests
Html Report (VSDrops) Download
❌ dotnettests tests (MacCatalyst)
Html Report (VSDrops) Download
❌ monotouch tests (MacCatalyst)
Tests run: 3150 Passed: 3012 Inconclusive: 13 Failed: 10 Ignored: 128)
Html Report (VSDrops) Download
Successes
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download
Pipeline on Agent
Hash: c51ad863c8e5dc69250baaa720ad605abf98d017 [CI build]