Skip to content

Commit

Permalink
Merge pull request #777 from Sergio0694/dev/update-nuget
Browse files Browse the repository at this point in the history
Update NuGet packages to latest stable and fix code style
  • Loading branch information
Sergio0694 committed Mar 5, 2024
2 parents eba360d + a5aff06 commit be458c4
Show file tree
Hide file tree
Showing 54 changed files with 94 additions and 91 deletions.
Expand Up @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.2.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.2.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ComputeSharp.CodeFixers/ComputeSharp.CodeFixers.csproj
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ComputeSharp.CodeFixing/MissingAttributeCodeFixer.cs
Expand Up @@ -50,7 +50,7 @@ public abstract class MissingAttributeCodeFixer : CodeFixProvider
this.attributeFullyQualifiedMetadataName = attributeFullyQualifiedMetadataName;
this.leadingAttributeFullyQualifiedMetadataNames = leadingAttributeFullyQualifiedMetadataNames;

FixableDiagnosticIds = ImmutableArray.Create(diagnosticId);
FixableDiagnosticIds = [diagnosticId];
}

/// <inheritdoc/>
Expand Down
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" Pack="false" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -77,7 +77,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta" PrivateAssets="all" />
</ItemGroup>

Expand Down
Expand Up @@ -112,7 +112,7 @@ public static ImmutableArray<DiagnosticInfo> GetInfoDiagnostics(IMethodSymbol me
win32Error.HResult,
win32Error.Message);

return ImmutableArray.Create(diagnostic);
return [diagnostic];
}
else if (info is HlslBytecodeInfo.CompilerError fxcError)
{
Expand All @@ -123,10 +123,10 @@ public static ImmutableArray<DiagnosticInfo> GetInfoDiagnostics(IMethodSymbol me
methodSymbol.ContainingType,
fxcError.Message);

return ImmutableArray.Create(diagnostic);
return [diagnostic];
}

return ImmutableArray<DiagnosticInfo>.Empty;
return [];
}

/// <summary>
Expand Down
Expand Up @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class D2DEnableRuntimeCompilationOnAssemblyAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(D2DRuntimeCompilationOnAssemblyNotNecessary);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [D2DRuntimeCompilationOnAssemblyNotNecessary];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,10 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class D2DEnableRuntimeCompilationOnTypeAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(
D2DRuntimeCompilationDisabled,
D2DRuntimeCompilationAlreadyEnabled,
D2DRuntimeCompilationOnTypeNotNecessary);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [D2DRuntimeCompilationDisabled, D2DRuntimeCompilationAlreadyEnabled, D2DRuntimeCompilationOnTypeNotNecessary];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -15,7 +15,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class ExceededPixelShaderDispatchDataSizeAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(ExceededDispatchDataSize);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [ExceededDispatchDataSize];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidAssemblyLevelCompileOptionsAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidPackMatrixColumnMajorOption);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidPackMatrixColumnMajorOption];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2D1CompileOptionsEnableLinkingOnShaderTypeAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2D1CompileOptionsEnableLinkingOnShaderType);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2D1CompileOptionsEnableLinkingOnShaderType];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -16,9 +16,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DInputDescriptionAttributeUseAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(
OutOfRangeInputDescriptionIndex,
RepeatedD2DInputDescriptionIndices);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [OutOfRangeInputDescriptionIndex, RepeatedD2DInputDescriptionIndices];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DPixelShaderSourceAttributeUseAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DPixelShaderSource);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2DPixelShaderSource];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DPixelShaderSourceMethodReturnType);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2DPixelShaderSourceMethodReturnType];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DRequiresDoublePrecisionSupportAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DRequiresDoublePrecisionSupportAttribute);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2DRequiresDoublePrecisionSupportAttribute];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DResourceTextureIndexAttributeLocationAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DResourceTextureIndexAttributeLocation);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2DResourceTextureIndexAttributeLocation];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -16,11 +16,13 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidD2DResourceTextureIndexAttributeUseAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
[
MissingD2DResourceTextureIndexAttribute,
ResourceTextureIndexOverlappingWithInputIndex,
OutOfRangeResourceTextureIndex,
RepeatedD2DResourceTextureIndices);
RepeatedD2DResourceTextureIndices,
];
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidEffectIdValueAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidD2DEffectIdAttributeValue);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidD2DEffectIdAttributeValue];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -17,11 +17,13 @@ public sealed class InvalidEffectMetadataValueAnalyzer : DiagnosticAnalyzer
/// <summary>
/// The set of type names for all metadata attributes.
/// </summary>
private static readonly ImmutableArray<string> MetadataAttributeTypeNames = ImmutableArray.Create(
private static readonly ImmutableArray<string> MetadataAttributeTypeNames =
[
"ComputeSharp.D2D1.D2DEffectDisplayNameAttribute",
"ComputeSharp.D2D1.D2DEffectDescriptionAttribute",
"ComputeSharp.D2D1.D2DEffectCategoryAttribute",
"ComputeSharp.D2D1.D2DEffectAuthorAttribute");
"ComputeSharp.D2D1.D2DEffectAuthorAttribute",
];

/// <summary>
/// The mapping of diagnostics to their attribute type names.
Expand All @@ -35,11 +37,13 @@ public sealed class InvalidEffectMetadataValueAnalyzer : DiagnosticAnalyzer
]);

/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
[
InvalidD2DEffectDisplayNameAttributeValue,
InvalidD2DEffectDescriptionAttributeValue,
InvalidD2DEffectCategoryAttributeValue,
InvalidD2DEffectAuthorAttributeValue);
InvalidD2DEffectAuthorAttributeValue,
];
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -13,7 +13,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidShaderTypeCompileOptionsAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(InvalidPackMatrixColumnMajorOption);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [InvalidPackMatrixColumnMajorOption];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -16,13 +16,15 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class InvalidShaderTypeInputsAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
[
MissingD2DInputCountAttribute,
InvalidD2DInputCount,
OutOfRangeInputIndex,
RepeatedD2DInputSimpleIndices,
RepeatedD2DInputComplexIndices,
InvalidSimpleAndComplexIndicesCombination);
InvalidSimpleAndComplexIndicesCombination,
];
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(MissingCompileOptionsForD2DPixelShaderSource);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [MissingCompileOptionsForD2DPixelShaderSource];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(MissingShaderProfileForD2DPixelShaderSource);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [MissingShaderProfileForD2DPixelShaderSource];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -14,7 +14,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class MissingPixelShaderDescriptorOnPixelShaderAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(MissingPixelShaderDescriptorOnPixelShaderType);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [MissingPixelShaderDescriptorOnPixelShaderType];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down
@@ -1,4 +1,3 @@
using System.Collections.Immutable;
using ComputeSharp.SourceGeneration.Diagnostics;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
Expand All @@ -14,7 +13,7 @@ public sealed class NotReadOnlyPixelShaderTypeWithFieldsAnalyzer : NotReadOnlySh
/// Creates a new <see cref="NotReadOnlyPixelShaderTypeWithFieldsAnalyzer"/> instance.
/// </summary>
public NotReadOnlyPixelShaderTypeWithFieldsAnalyzer()
: base(NotReadOnlyShaderType, ImmutableArray.Create("ComputeSharp.D2D1.ID2D1PixelShader"))
: base(NotReadOnlyShaderType, ["ComputeSharp.D2D1.ID2D1PixelShader"])
{
}
}
Expand Up @@ -31,7 +31,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
public sealed class D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor : DiagnosticSuppressor
{
/// <inheritdoc/>
public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions => ImmutableArray.Create(UninitializedD2D1ResourceTextureField);
public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions => [UninitializedD2D1ResourceTextureField];

/// <inheritdoc/>
public override void ReportSuppressions(SuppressionAnalysisContext context)
Expand Down
Expand Up @@ -12,7 +12,7 @@ namespace ComputeSharp.SourceGeneration.Diagnostics;
public abstract class MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase(DiagnosticDescriptor diagnosticDescriptor) : DiagnosticAnalyzer
{
/// <inheritdoc/>
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor);
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [diagnosticDescriptor];

/// <inheritdoc/>
public sealed override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -15,7 +15,7 @@ public abstract class NotAccessibleFieldTypeInGeneratedShaderDescriptorAttribute
string generatedShaderDescriptorFullyQualifiedTypeName) : DiagnosticAnalyzer
{
/// <inheritdoc/>
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor);
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [diagnosticDescriptor];

/// <inheritdoc/>
public sealed override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -15,7 +15,7 @@ public abstract class NotAccessibleGeneratedShaderDescriptorAttributeTargetAnaly
string generatedShaderDescriptorFullyQualifiedTypeName) : DiagnosticAnalyzer
{
/// <inheritdoc/>
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor);
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [diagnosticDescriptor];

/// <inheritdoc/>
public sealed override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -16,7 +16,7 @@ public abstract class NotReadOnlyShaderTypeWithFieldsAnalyzerBase(
ImmutableArray<string> shaderInterfaceTypeFullyQualifiedMetadataNames) : DiagnosticAnalyzer
{
/// <inheritdoc/>
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(diagnosticDescriptor);
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [diagnosticDescriptor];

/// <inheritdoc/>
public sealed override void Initialize(AnalysisContext context)
Expand Down
Expand Up @@ -99,7 +99,7 @@ internal static partial class ConstantBufferSyntaxProcessor
GetInfo(
compilation,
structDeclarationSymbol,
ImmutableArray<FieldPathPart>.Empty,
[],
ref constantBufferSizeInBytes,
fieldBuilder);

Expand Down
Expand Up @@ -57,7 +57,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta" PrivateAssets="all" />
</ItemGroup>

Expand Down
Expand Up @@ -17,7 +17,7 @@ namespace ComputeSharp.SourceGenerators;
public sealed class ExcedeedComputeShaderDispatchDataSizeAnalyzer : DiagnosticAnalyzer
{
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(ShaderDispatchDataSizeExceeded);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [ShaderDispatchDataSizeExceeded];

/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
Expand Down

0 comments on commit be458c4

Please sign in to comment.