diff --git a/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs b/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs
index ef98cdb6..36e05558 100644
--- a/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs
+++ b/src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs
@@ -50,7 +50,7 @@ public abstract class MissingAttributeCodeFixer : CodeFixProvider
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 daf3fcea..d728efce 100644
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs
+++ b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs
@@ -112,7 +112,7 @@ partial class D2DPixelShaderSourceGenerator
win32Error.HResult,
win32Error.Message);
- return ImmutableArray.Create(diagnostic);
+ return [diagnostic];
}
else if (info is HlslBytecodeInfo.CompilerError fxcError)
{
@@ -123,10 +123,10 @@ partial class D2DPixelShaderSourceGenerator
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 bed88bf1..559f2263 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 2d64da80..e5e70edd 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 249786fe..69a850bb 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 ac525a1a..5b3ad418 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 9309950f..99e1c13c 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 49f9b8fd..e0575e7d 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 23d7d45c..2a04487d 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 7b4464e3..81aa7621 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 e30cd119..cd1053bb 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 fdfe86d1..4d2b48d6 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 09f99388..e65386a8 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 c2a0d7f3..091f8e80 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 f2f0e57f..2f552484 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 5067edb0..0c4f30ca 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 7ff2932e..636cd0b0 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 95192608..1ffcbe69 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 654ed07d..053c5c1b 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 6eb10b60..7b506a9e 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 0014a534..72db3997 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 b860616a..7690a51e 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 664da567..c80cf927 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 8f620e8b..9fe78f1e 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 cd91417a..c83897dd 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 8c5ed57c..21151403 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 1b70e96b..64d3ad66 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 4c9e4c42..4311d33b 100644
--- a/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxProcessors/ConstantBufferSyntaxProcessor.cs
+++ b/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxProcessors/ConstantBufferSyntaxProcessor.cs
@@ -99,7 +99,7 @@ internal static partial class ConstantBufferSyntaxProcessor
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 aca40737..4742420a 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 9bfad686..1cc95e52 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 3035b23e..d673102f 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 aa084b5e..fbb9ed2c 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 c9f1faeb..bbe30a03 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 1f7fb94b..c95fc3a1 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 632c4ea2..ccd8e8d3 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 de85a567..e34c922e 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 39b7889b..be2e6928 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