[release/8.0] Fix diagnostic creation to ensure including the URI (#91145)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 28 Aug 2023 16:16:25 +0000 (09:16 -0700)
committerGitHub <noreply@github.com>
Mon, 28 Aug 2023 16:16:25 +0000 (09:16 -0700)
* Fix diagnostic creation to ensure including the URI

* Fix the same issue with the Interop source gen

---------

Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/DiagnosticDescriptors.cs
src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/GeneratorDiagnostics.cs

index ec89ae4..409ab6d 100644 (file)
@@ -201,7 +201,7 @@ namespace Microsoft.Extensions.Logging.Generators
             DiagnosticSeverity.Warning,
             isEnabledByDefault: true);
 
-        public static DiagnosticDescriptor LoggingUnsupportedLanguageVersion { get; } = new DiagnosticDescriptor(
+        public static DiagnosticDescriptor LoggingUnsupportedLanguageVersion { get; } = DiagnosticDescriptorHelper.Create(
             id: "SYSLIB1026",
             title: new LocalizableResourceString(nameof(SR.LoggingUnsupportedLanguageVersionTitle), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Logging.Generators.SR)),
             messageFormat: new LocalizableResourceString(nameof(SR.LoggingUnsupportedLanguageVersionMessageFormat), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Logging.Generators.SR)),
index f0b98c3..b213e3a 100644 (file)
@@ -477,7 +477,7 @@ namespace Microsoft.Interop
 
         /// <inheritdoc cref="SR.HResultTypeWillBeTreatedAsStructMessage"/>
         public static readonly DiagnosticDescriptor HResultTypeWillBeTreatedAsStruct =
-            new DiagnosticDescriptor(
+            DiagnosticDescriptorHelper.Create(
                 Ids.NotRecommendedGeneratedComInterfaceUsage,
                 GetResourceString(nameof(SR.HResultTypeWillBeTreatedAsStructTitle)),
                 GetResourceString(nameof(SR.HResultTypeWillBeTreatedAsStructMessage)),