From 10ef020591afb71e8140f99c8da478746c9908c5 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 5 Mar 2024 10:40:02 -0800 Subject: [PATCH 1/2] Update NuGet packages to latest (no WASDK) --- .../ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj | 2 +- .../ComputeSharp.ImageProcessing.csproj | 2 +- .../ComputeSharp.CodeFixers.csproj | 2 +- .../ComputeSharp.Core.SourceGenerators.csproj | 2 +- .../ComputeSharp.D2D1.CodeFixers.csproj | 2 +- .../ComputeSharp.D2D1.SourceGenerators.csproj | 2 +- .../ComputeSharp.SourceGenerators.csproj | 2 +- ...ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj | 4 ++-- .../ComputeSharp.D2D1.Tests.SourceGenerators.csproj | 8 ++++---- .../ComputeSharp.D2D1.Tests.csproj | 8 ++++---- .../ComputeSharp.D2D1.WinUI.Tests.csproj | 6 +++--- .../ComputeSharp.Tests.DeviceLost.csproj | 6 +++--- .../ComputeSharp.Tests.DisableDynamicCompilation.csproj | 6 +++--- .../ComputeSharp.Tests.Internals.csproj | 6 +++--- .../ComputeSharp.Tests.NativeLibrariesResolver.csproj | 4 ++-- .../ComputeSharp.Tests.SourceGenerators.csproj | 8 ++++---- tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj | 8 ++++---- 17 files changed, 39 insertions(+), 39 deletions(-) diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj index ae541f48a..82af0487e 100644 --- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj +++ b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj @@ -20,7 +20,7 @@ - + diff --git a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj index e6e779109..8990087e4 100644 --- a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj +++ b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/ComputeSharp.CodeFixers/ComputeSharp.CodeFixers.csproj b/src/ComputeSharp.CodeFixers/ComputeSharp.CodeFixers.csproj index dc0ba9f32..685c48f96 100644 --- a/src/ComputeSharp.CodeFixers/ComputeSharp.CodeFixers.csproj +++ b/src/ComputeSharp.CodeFixers/ComputeSharp.CodeFixers.csproj @@ -4,7 +4,7 @@ - + diff --git a/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj b/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj index f42af9951..a65da1f7a 100644 --- a/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj +++ b/src/ComputeSharp.Core.SourceGenerators/ComputeSharp.Core.SourceGenerators.csproj @@ -4,7 +4,7 @@ - + diff --git a/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj b/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj index 40dfcf886..dbfc9741f 100644 --- a/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj +++ b/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj @@ -4,7 +4,7 @@ - + diff --git a/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj b/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj index 478f9a4ee..387b445bc 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj +++ b/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj @@ -77,7 +77,7 @@ - + diff --git a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj index 487bf38aa..f69d908e4 100644 --- a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj +++ b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj @@ -57,7 +57,7 @@ - + diff --git a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj b/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj index e9311497e..da5e283de 100644 --- a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj +++ b/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj index 2d128c98d..620c770af 100644 --- a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj +++ b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj @@ -9,14 +9,14 @@ - + - - + + - + diff --git a/tests/ComputeSharp.D2D1.Tests/ComputeSharp.D2D1.Tests.csproj b/tests/ComputeSharp.D2D1.Tests/ComputeSharp.D2D1.Tests.csproj index 9d18dde50..f3baf9745 100644 --- a/tests/ComputeSharp.D2D1.Tests/ComputeSharp.D2D1.Tests.csproj +++ b/tests/ComputeSharp.D2D1.Tests/ComputeSharp.D2D1.Tests.csproj @@ -8,11 +8,11 @@ - + - - - + + + diff --git a/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj b/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj index ec62771a4..e821bebbc 100644 --- a/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj +++ b/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj @@ -56,10 +56,10 @@ - + - - + + diff --git a/tests/ComputeSharp.Tests.DeviceLost/ComputeSharp.Tests.DeviceLost.csproj b/tests/ComputeSharp.Tests.DeviceLost/ComputeSharp.Tests.DeviceLost.csproj index 535597563..8bc08f1d1 100644 --- a/tests/ComputeSharp.Tests.DeviceLost/ComputeSharp.Tests.DeviceLost.csproj +++ b/tests/ComputeSharp.Tests.DeviceLost/ComputeSharp.Tests.DeviceLost.csproj @@ -10,11 +10,11 @@ - + - - + + diff --git a/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj b/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj index ae2557ae0..386cea429 100644 --- a/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj +++ b/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj @@ -5,11 +5,11 @@ - + - - + + diff --git a/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj b/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj index 2d8adc368..4c2b2b875 100644 --- a/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj +++ b/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj @@ -5,11 +5,11 @@ - + - - + + diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj b/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj index 2ce61f3d4..e900cf1f1 100644 --- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj b/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj index 157ba1e68..dbc7ac6db 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj +++ b/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj @@ -8,12 +8,12 @@ - + - - - + + + diff --git a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj index a1bbc8982..96444690b 100644 --- a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj +++ b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj @@ -10,13 +10,13 @@ - + - - - + + + From a5aff06390674066aaf451b5de2b73625a169626 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 5 Mar 2024 10:44:30 -0800 Subject: [PATCH 2/2] Fix all new code style warnings --- .../MissingAttributeCodeFixer.cs | 2 +- .../D2DPixelShaderSourceGenerator.Execute.cs | 6 +++--- .../D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs | 2 +- .../D2DEnableRuntimeCompilationOnTypeAnalyzer.cs | 5 +---- .../ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs | 2 +- .../InvalidAssemblyLevelCompileOptionsAnalyzer.cs | 2 +- ...ompileOptionsEnableLinkingOnShaderTypeAnalyzer.cs | 2 +- ...edPixelShaderDescriptorAttributeTargetAnalyzer.cs | 2 +- ...InvalidD2DInputDescriptionAttributeUseAnalyzer.cs | 4 +--- ...nvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs | 2 +- ...idD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs | 2 +- ...validD2DRequiresDoublePrecisionSupportAnalyzer.cs | 2 +- ...DResourceTextureIndexAttributeLocationAnalyzer.cs | 2 +- ...lidD2DResourceTextureIndexAttributeUseAnalyzer.cs | 6 ++++-- .../Analyzers/InvalidEffectIdValueAnalyzer.cs | 2 +- .../Analyzers/InvalidEffectMetadataValueAnalyzer.cs | 12 ++++++++---- .../InvalidShaderTypeCompileOptionsAnalyzer.cs | 2 +- .../Analyzers/InvalidShaderTypeInputsAnalyzer.cs | 6 ++++-- ...ileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs | 2 +- ...derProfileOnD2DPixelShaderSourceMethodAnalyzer.cs | 2 +- ...singPixelShaderDescriptorOnPixelShaderAnalyzer.cs | 2 +- .../NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs | 3 +-- ...eTextureUninitializedFieldDiagnosticSuppressor.cs | 2 +- ...AllowUnsafeBlocksCompilationOptionAnalyzerBase.cs | 2 +- ...tedShaderDescriptorAttributeTargetAnalyzerBase.cs | 2 +- ...tedShaderDescriptorAttributeTargetAnalyzerBase.cs | 2 +- .../NotReadOnlyShaderTypeWithFieldsAnalyzerBase.cs | 2 +- .../ConstantBufferSyntaxProcessor.cs | 2 +- .../ExcedeedComputeShaderDispatchDataSizeAnalyzer.cs | 2 +- .../Analyzers/InvalidComputeContextCopyAnalyzer.cs | 2 +- ...ComputeShaderDescriptorAttributeTargetAnalyzer.cs | 2 +- ...nvalidGloballyCoherentFieldDeclarationAnalyzer.cs | 2 +- .../InvalidGroupSharedFieldDeclarationAnalyzer.cs | 2 +- .../InvalidThreadGroupSizeAttributeUseAnalyzer.cs | 6 ++++-- ...ComputeShaderDescriptorOnComputeShaderAnalyzer.cs | 2 +- ...pleComputeShaderInterfacesOnShaderTypeAnalyzer.cs | 2 +- ...NotReadOnlyComputeShaderTypeWithFieldsAnalyzer.cs | 3 +-- 37 files changed, 55 insertions(+), 52 deletions(-) diff --git a/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs b/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs index ef98cdb69..36e055585 100644 --- a/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs +++ b/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs @@ -50,7 +50,7 @@ private protected MissingAttributeCodeFixer( this.attributeFullyQualifiedMetadataName = attributeFullyQualifiedMetadataName; this.leadingAttributeFullyQualifiedMetadataNames = leadingAttributeFullyQualifiedMetadataNames; - FixableDiagnosticIds = ImmutableArray.Create(diagnosticId); + FixableDiagnosticIds = [diagnosticId]; } /// diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs index daf3fcea2..d728efce4 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs @@ -112,7 +112,7 @@ public static ImmutableArray GetInfoDiagnostics(IMethodSymbol me win32Error.HResult, win32Error.Message); - return ImmutableArray.Create(diagnostic); + return [diagnostic]; } else if (info is HlslBytecodeInfo.CompilerError fxcError) { @@ -123,10 +123,10 @@ public static ImmutableArray GetInfoDiagnostics(IMethodSymbol me methodSymbol.ContainingType, fxcError.Message); - return ImmutableArray.Create(diagnostic); + return [diagnostic]; } - return ImmutableArray.Empty; + return []; } /// diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs index bed88bf1b..559f22636 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class D2DEnableRuntimeCompilationOnAssemblyAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(D2DRuntimeCompilationOnAssemblyNotNecessary); + public override ImmutableArray SupportedDiagnostics { get; } = [D2DRuntimeCompilationOnAssemblyNotNecessary]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs index 2d64da803..e5e70eddb 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs @@ -14,10 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class D2DEnableRuntimeCompilationOnTypeAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( - D2DRuntimeCompilationDisabled, - D2DRuntimeCompilationAlreadyEnabled, - D2DRuntimeCompilationOnTypeNotNecessary); + public override ImmutableArray SupportedDiagnostics { get; } = [D2DRuntimeCompilationDisabled, D2DRuntimeCompilationAlreadyEnabled, D2DRuntimeCompilationOnTypeNotNecessary]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs index 249786fe1..69a850bbf 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs @@ -15,7 +15,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class ExceededPixelShaderDispatchDataSizeAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(ExceededDispatchDataSize); + public override ImmutableArray SupportedDiagnostics { get; } = [ExceededDispatchDataSize]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs index ac525a1af..5b3ad4186 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidAssemblyLevelCompileOptionsAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidPackMatrixColumnMajorOption); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidPackMatrixColumnMajorOption]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1CompileOptionsEnableLinkingOnShaderTypeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1CompileOptionsEnableLinkingOnShaderTypeAnalyzer.cs index 9309950fe..99e1c13c4 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1CompileOptionsEnableLinkingOnShaderTypeAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1CompileOptionsEnableLinkingOnShaderTypeAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2D1CompileOptionsEnableLinkingOnShaderTypeAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2D1CompileOptionsEnableLinkingOnShaderType); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2D1CompileOptionsEnableLinkingOnShaderType]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs index 49f9b8fd5..e0575e7df 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs index 23d7d45c0..2a04487d3 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs @@ -16,9 +16,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DInputDescriptionAttributeUseAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( - OutOfRangeInputDescriptionIndex, - RepeatedD2DInputDescriptionIndices); + public override ImmutableArray SupportedDiagnostics { get; } = [OutOfRangeInputDescriptionIndex, RepeatedD2DInputDescriptionIndices]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs index 7b4464e31..81aa76214 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DPixelShaderSourceAttributeUseAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DPixelShaderSource); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DPixelShaderSource]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs index e30cd1190..cd1053bbb 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DPixelShaderSourceMethodReturnType); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DPixelShaderSourceMethodReturnType]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs index fdfe86d19..4d2b48d69 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DRequiresDoublePrecisionSupportAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DRequiresDoublePrecisionSupportAttribute); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DRequiresDoublePrecisionSupportAttribute]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs index 09f993881..e65386a84 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DResourceTextureIndexAttributeLocationAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DResourceTextureIndexAttributeLocation); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DResourceTextureIndexAttributeLocation]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs index c2a0d7f36..091f8e805 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs @@ -16,11 +16,13 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidD2DResourceTextureIndexAttributeUseAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( + public override ImmutableArray SupportedDiagnostics { get; } = + [ MissingD2DResourceTextureIndexAttribute, ResourceTextureIndexOverlappingWithInputIndex, OutOfRangeResourceTextureIndex, - RepeatedD2DResourceTextureIndices); + RepeatedD2DResourceTextureIndices, + ]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs index f2f0e57f0..2f552484b 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidEffectIdValueAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DEffectIdAttributeValue); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DEffectIdAttributeValue]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs index 5067edb01..0c4f30ca1 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs @@ -17,11 +17,13 @@ public sealed class InvalidEffectMetadataValueAnalyzer : DiagnosticAnalyzer /// /// The set of type names for all metadata attributes. /// - private static readonly ImmutableArray MetadataAttributeTypeNames = ImmutableArray.Create( + private static readonly ImmutableArray MetadataAttributeTypeNames = + [ "ComputeSharp.D2D1.D2DEffectDisplayNameAttribute", "ComputeSharp.D2D1.D2DEffectDescriptionAttribute", "ComputeSharp.D2D1.D2DEffectCategoryAttribute", - "ComputeSharp.D2D1.D2DEffectAuthorAttribute"); + "ComputeSharp.D2D1.D2DEffectAuthorAttribute", + ]; /// /// The mapping of diagnostics to their attribute type names. @@ -35,11 +37,13 @@ public sealed class InvalidEffectMetadataValueAnalyzer : DiagnosticAnalyzer ]); /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( + public override ImmutableArray SupportedDiagnostics { get; } = + [ InvalidD2DEffectDisplayNameAttributeValue, InvalidD2DEffectDescriptionAttributeValue, InvalidD2DEffectCategoryAttributeValue, - InvalidD2DEffectAuthorAttributeValue); + InvalidD2DEffectAuthorAttributeValue, + ]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs index 7ff2932e4..636cd0b0d 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidShaderTypeCompileOptionsAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidPackMatrixColumnMajorOption); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidPackMatrixColumnMajorOption]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs index 951926087..1ffcbe69a 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs @@ -16,13 +16,15 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class InvalidShaderTypeInputsAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( + public override ImmutableArray SupportedDiagnostics { get; } = + [ MissingD2DInputCountAttribute, InvalidD2DInputCount, OutOfRangeInputIndex, RepeatedD2DInputSimpleIndices, RepeatedD2DInputComplexIndices, - InvalidSimpleAndComplexIndicesCombination); + InvalidSimpleAndComplexIndicesCombination, + ]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs index 654ed07dd..053c5c1bc 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(MissingCompileOptionsForD2DPixelShaderSource); + public override ImmutableArray SupportedDiagnostics { get; } = [MissingCompileOptionsForD2DPixelShaderSource]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs index 6eb10b60a..7b506a9e7 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(MissingShaderProfileForD2DPixelShaderSource); + public override ImmutableArray SupportedDiagnostics { get; } = [MissingShaderProfileForD2DPixelShaderSource]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs index 0014a5342..72db3997c 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class MissingPixelShaderDescriptorOnPixelShaderAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(MissingPixelShaderDescriptorOnPixelShaderType); + public override ImmutableArray SupportedDiagnostics { get; } = [MissingPixelShaderDescriptorOnPixelShaderType]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs index b860616af..7690a51e3 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs @@ -1,4 +1,3 @@ -using System.Collections.Immutable; using ComputeSharp.SourceGeneration.Diagnostics; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -14,7 +13,7 @@ public sealed class NotReadOnlyPixelShaderTypeWithFieldsAnalyzer : NotReadOnlySh /// Creates a new instance. /// public NotReadOnlyPixelShaderTypeWithFieldsAnalyzer() - : base(NotReadOnlyShaderType, ImmutableArray.Create("ComputeSharp.D2D1.ID2D1PixelShader")) + : base(NotReadOnlyShaderType, ["ComputeSharp.D2D1.ID2D1PixelShader"]) { } } \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs index 664da5675..c80cf9272 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs @@ -31,7 +31,7 @@ namespace ComputeSharp.D2D1.SourceGenerators; public sealed class D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor : DiagnosticSuppressor { /// - public override ImmutableArray SupportedSuppressions => ImmutableArray.Create(UninitializedD2D1ResourceTextureField); + public override ImmutableArray SupportedSuppressions => [UninitializedD2D1ResourceTextureField]; /// public override void ReportSuppressions(SuppressionAnalysisContext context) diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase.cs b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase.cs index 8f620e8b8..9fe78f1e0 100644 --- a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase.cs +++ b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase.cs @@ -12,7 +12,7 @@ namespace ComputeSharp.SourceGeneration.Diagnostics; public abstract class MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase(DiagnosticDescriptor diagnosticDescriptor) : DiagnosticAnalyzer { /// - public sealed override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor); + public sealed override ImmutableArray SupportedDiagnostics { get; } = [diagnosticDescriptor]; /// public sealed override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleFieldTypeInGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleFieldTypeInGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs index cd91417a7..c83897dd0 100644 --- a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleFieldTypeInGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs +++ b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleFieldTypeInGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs @@ -15,7 +15,7 @@ public abstract class NotAccessibleFieldTypeInGeneratedShaderDescriptorAttribute string generatedShaderDescriptorFullyQualifiedTypeName) : DiagnosticAnalyzer { /// - public sealed override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor); + public sealed override ImmutableArray SupportedDiagnostics { get; } = [diagnosticDescriptor]; /// public sealed override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs index 8c5ed57c8..211514030 100644 --- a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs +++ b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotAccessibleGeneratedShaderDescriptorAttributeTargetAnalyzerBase.cs @@ -15,7 +15,7 @@ public abstract class NotAccessibleGeneratedShaderDescriptorAttributeTargetAnaly string generatedShaderDescriptorFullyQualifiedTypeName) : DiagnosticAnalyzer { /// - public sealed override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor); + public sealed override ImmutableArray SupportedDiagnostics { get; } = [diagnosticDescriptor]; /// public sealed override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotReadOnlyShaderTypeWithFieldsAnalyzerBase.cs b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotReadOnlyShaderTypeWithFieldsAnalyzerBase.cs index 1b70e96b4..64d3ad669 100644 --- a/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotReadOnlyShaderTypeWithFieldsAnalyzerBase.cs +++ b/src/ComputeSharp.SourceGeneration.Hlsl/Diagnostics/Analyzers/NotReadOnlyShaderTypeWithFieldsAnalyzerBase.cs @@ -16,7 +16,7 @@ public abstract class NotReadOnlyShaderTypeWithFieldsAnalyzerBase( ImmutableArray shaderInterfaceTypeFullyQualifiedMetadataNames) : DiagnosticAnalyzer { /// - public sealed override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor); + public sealed override ImmutableArray SupportedDiagnostics { get; } = [diagnosticDescriptor]; /// public sealed override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxProcessors/ConstantBufferSyntaxProcessor.cs b/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxProcessors/ConstantBufferSyntaxProcessor.cs index 4c9e4c42f..4311d33b6 100644 --- a/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxProcessors/ConstantBufferSyntaxProcessor.cs +++ b/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxProcessors/ConstantBufferSyntaxProcessor.cs @@ -99,7 +99,7 @@ static void GetInfo( GetInfo( compilation, structDeclarationSymbol, - ImmutableArray.Empty, + [], ref constantBufferSizeInBytes, fieldBuilder); diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/ExcedeedComputeShaderDispatchDataSizeAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/ExcedeedComputeShaderDispatchDataSizeAnalyzer.cs index aca40737a..4742420ad 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/ExcedeedComputeShaderDispatchDataSizeAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/ExcedeedComputeShaderDispatchDataSizeAnalyzer.cs @@ -17,7 +17,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class ExcedeedComputeShaderDispatchDataSizeAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(ShaderDispatchDataSizeExceeded); + public override ImmutableArray SupportedDiagnostics { get; } = [ShaderDispatchDataSizeExceeded]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidComputeContextCopyAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidComputeContextCopyAnalyzer.cs index 9bfad686e..1cc95e525 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidComputeContextCopyAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidComputeContextCopyAnalyzer.cs @@ -15,7 +15,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class InvalidComputeContextCopyAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidComputeContextCopy); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidComputeContextCopy]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedComputeShaderDescriptorAttributeTargetAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedComputeShaderDescriptorAttributeTargetAnalyzer.cs index 3035b23ea..d673102fe 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedComputeShaderDescriptorAttributeTargetAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedComputeShaderDescriptorAttributeTargetAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class InvalidGeneratedComputeShaderDescriptorAttributeTargetAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidGeneratedComputeShaderDescriptorAttributeTarget); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidGeneratedComputeShaderDescriptorAttributeTarget]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGloballyCoherentFieldDeclarationAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGloballyCoherentFieldDeclarationAnalyzer.cs index aa084b5eb..fbb9ed2c0 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGloballyCoherentFieldDeclarationAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGloballyCoherentFieldDeclarationAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class InvalidGloballyCoherentFieldDeclarationAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidGloballyCoherentFieldDeclaration); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidGloballyCoherentFieldDeclaration]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGroupSharedFieldDeclarationAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGroupSharedFieldDeclarationAnalyzer.cs index c9f1faeb6..bbe30a038 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGroupSharedFieldDeclarationAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidGroupSharedFieldDeclarationAnalyzer.cs @@ -13,7 +13,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class InvalidGroupSharedFieldDeclarationAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidGroupSharedFieldDeclaration); + public override ImmutableArray SupportedDiagnostics { get; } = [InvalidGroupSharedFieldDeclaration]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidThreadGroupSizeAttributeUseAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidThreadGroupSizeAttributeUseAnalyzer.cs index 1f7fb94ba..c95fc3a1b 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidThreadGroupSizeAttributeUseAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/InvalidThreadGroupSizeAttributeUseAnalyzer.cs @@ -14,10 +14,12 @@ namespace ComputeSharp.SourceGenerators; public sealed class InvalidThreadGroupSizeAttributeUseAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( + public override ImmutableArray SupportedDiagnostics { get; } = + [ MissingThreadGroupSizeAttribute, InvalidThreadGroupSizeAttributeDefaultThreadGroupSizes, - InvalidThreadGroupSizeAttributeValues); + InvalidThreadGroupSizeAttributeValues, + ]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MissingComputeShaderDescriptorOnComputeShaderAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MissingComputeShaderDescriptorOnComputeShaderAnalyzer.cs index 632c4ea2e..ccd8e8d39 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MissingComputeShaderDescriptorOnComputeShaderAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MissingComputeShaderDescriptorOnComputeShaderAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class MissingComputeShaderDescriptorOnComputeShaderAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(MissingComputeShaderDescriptorOnComputeShaderType); + public override ImmutableArray SupportedDiagnostics { get; } = [MissingComputeShaderDescriptorOnComputeShaderType]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MultipleComputeShaderInterfacesOnShaderTypeAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MultipleComputeShaderInterfacesOnShaderTypeAnalyzer.cs index de85a5672..e34c922e2 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MultipleComputeShaderInterfacesOnShaderTypeAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/MultipleComputeShaderInterfacesOnShaderTypeAnalyzer.cs @@ -14,7 +14,7 @@ namespace ComputeSharp.SourceGenerators; public sealed class MultipleComputeShaderInterfacesOnShaderTypeAnalyzer : DiagnosticAnalyzer { /// - public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(MultipleShaderTypesImplemented); + public override ImmutableArray SupportedDiagnostics { get; } = [MultipleShaderTypesImplemented]; /// public override void Initialize(AnalysisContext context) diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyComputeShaderTypeWithFieldsAnalyzer.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyComputeShaderTypeWithFieldsAnalyzer.cs index 39b7889bc..be2e69280 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyComputeShaderTypeWithFieldsAnalyzer.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyComputeShaderTypeWithFieldsAnalyzer.cs @@ -1,4 +1,3 @@ -using System.Collections.Immutable; using ComputeSharp.SourceGeneration.Diagnostics; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -14,7 +13,7 @@ public sealed class NotReadOnlyComputeShaderTypeWithFieldsAnalyzer : NotReadOnly /// Creates a new instance. /// public NotReadOnlyComputeShaderTypeWithFieldsAnalyzer() - : base(NotReadOnlyShaderType, ImmutableArray.Create("ComputeSharp.IComputeShader", "ComputeSharp.IComputeShader`1")) + : base(NotReadOnlyShaderType, ["ComputeSharp.IComputeShader", "ComputeSharp.IComputeShader`1"]) { } } \ No newline at end of file