From d5b004971768658e4b2128eccd42ae1d5bf48097 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:49:23 -0700 Subject: [PATCH 1/2] code example cleanup --- .../IniConfigurationProvider.xml | 2 +- .../PolicyHttpMessageHandler.xml | 6 +++--- .../InlineArrayAttribute.xml | 5 +++-- .../SwiftError.xml | 14 ++++++++------ .../SwiftIndirectResult.xml | 8 ++++---- .../SwiftSelf.xml | 14 ++++++++------ .../SwiftSelf`1.xml | 14 ++++++++------ 7 files changed, 35 insertions(+), 28 deletions(-) diff --git a/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml b/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml index 3c55a309abf..dd98f46445b 100644 --- a/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml +++ b/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml @@ -43,7 +43,7 @@ INI files are simple line structures ([INI Files on Wikipedia](https://en.wikipedia.org/wiki/INI_file)). The following example demonstrates a structure of the INI file: -``` +```ini [Section:Header] key1=value1 key2 = " value2 " diff --git a/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml b/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml index de313a16430..fb8b23d79ed 100644 --- a/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml +++ b/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml @@ -36,9 +36,9 @@ The and the convenience methods only accept the generic . Generic policy instances can be created by using the generic methods on such as . To adapt an existing non-generic , use code like the following: - -``` -policy.AsAsyncPolicy<HttpResponseMessage>() + +```csharp +policy.AsAsyncPolicy() ``` The method is an opinionated convenience method that supports the application of a policy for requests that fail due to a connection failure or server error (5XX HTTP status code). This kind of method supports only reactive policies such as Retry, Circuit-Breaker or Fallback. This method is only provided for convenience; we recommend creating your own policies as needed if this does not meet your requirements. diff --git a/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml b/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml index 9fac13f34c7..57f22e95a02 100644 --- a/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml @@ -35,7 +35,7 @@ This attribute can be used to annotate a `struct` type with a single field. The runtime replicates that field in the actual type layout as many times as is specified. > [!IMPORTANT] -> .NET 9 and later, the default implementations of `Equals()` and `GetHashCode()` for types marked with this attribute throw . You must override both and if they will be used. +> In .NET 9 and later versions, the default implementations of `Equals()` and `GetHashCode()` for types marked with this attribute throw . You must override both and if they will be used. ]]> @@ -46,7 +46,8 @@ This attribute can be used to annotate a `struct` type with a single field. The { private float _value; } - + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftError.xml b/xml/System.Runtime.InteropServices.Swift/SwiftError.xml index c518036d9d3..410134cf9c2 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftError.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftError.xml @@ -26,12 +26,14 @@ Represents the Swift error context, indicating that the argument is the error context. - - This struct is used to retrieve the 'error' context from Swift functions in the context of interop with .NET. - - Here's an example of how a SwiftError can be declared: - [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [DllImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftError* error); - + This struct is used to retrieve the 'error' context from Swift functions in the context of interop with .NET. + Here's an example of how a SwiftError can be declared: + + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] + [DllImport("SwiftLibrary", EntryPoint = "export")] + public static extern void swiftFunction(SwiftError* error); + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml b/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml index 13758df3b6e..e81bd41d668 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml @@ -26,14 +26,14 @@ Represents the Swift return buffer context. - This struct is used to access the return buffer when interoping with Swift functions that return non-frozen structs. - It provides a pointer to the memory location where the result should be stored. + This struct is used to access the return buffer when interoping with Swift functions that return non-frozen structs. It provides a pointer to the memory location where the result should be stored. Here's an example of how a SwiftIndirectResult can be declared: - + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [LibraryImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftIndirectResult result); - + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml b/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml index 93a851127e9..1848f086d69 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml @@ -26,12 +26,14 @@ Represents the Swift 'self' context, indicating that the argument is the self context. - - This struct is used to pass the 'self' context to Swift functions in the context of interop with .NET. - - Here's an example of how a SwiftSelf context can be declared: - [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [DllImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftSelf self); - + This struct is used to pass the 'self' context to Swift functions in the context of interop with .NET. + Here's an example of how a SwiftSelf context can be declared: + + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] + [DllImport("SwiftLibrary", EntryPoint = "export")] + public static extern void swiftFunction(SwiftSelf self); + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml b/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml index bfc761a6b61..00a1f5c083a 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml @@ -38,12 +38,14 @@ The type of the frozen struct to pass in the 'self' context. Represents the Swift 'self' context when the argument is Swift frozen struct T, which is either enregistered into multiple registers, or passed by reference in the 'self' register. - - This struct is used to pass the Swift frozen struct T to Swift functions in the context of interop with .NET. - - Here's an example of how a SwiftSelf<T> context can be declared: - [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [LibraryImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftSelf<T> self); - + This struct is used to pass the Swift frozen struct T to Swift functions in the context of interop with .NET. + Here's an example of how a SwiftSelf<T> context can be declared: + + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] + [LibraryImport("SwiftLibrary", EntryPoint = "export")] + public static extern void swiftFunction(SwiftSelf<T> self); + + From 109c07f84487605bf170b609f78b8315898327ba Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:52:59 -0700 Subject: [PATCH 2/2] encode angle brackets --- xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml b/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml index fb8b23d79ed..cfc8948e139 100644 --- a/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml +++ b/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml @@ -38,7 +38,7 @@ The , use code like the following: ```csharp -policy.AsAsyncPolicy() +policy.AsAsyncPolicy<HttpResponseMessage>() ``` The method is an opinionated convenience method that supports the application of a policy for requests that fail due to a connection failure or server error (5XX HTTP status code). This kind of method supports only reactive policies such as Retry, Circuit-Breaker or Fallback. This method is only provided for convenience; we recommend creating your own policies as needed if this does not meet your requirements.