Added syntax rewriter for static constants

このコミットが含まれているのは:
Sergio Pedri committed 2021-03-07 19:27:39 +01:00
1 親 a3a58e3a89
コミット c14c64dbc7
3ファイル変更
+175 -13

検索条件に一致するファイルはありません

+32 -12
ファイルの表示
@@ -89,9 +89,6 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="ThreadIds"/> usage.
/// <para>
/// Format: <c>"The ThreadIds type is used in method {0} of type {1}"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidThreadIdsUsage = new(
id: "CMPS0006",
@@ -105,9 +102,6 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="GroupIds"/> usage.
/// <para>
/// Format: <c>"The GroupIds type is used in method {0} of type {1}"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidGroupIdsUsage = new(
id: "CMPS0007",
@@ -121,9 +115,6 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="GroupSize"/> usage.
/// <para>
/// Format: <c>"The GroupSize type is used in method {0} of type {1}"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidGroupSizeUsage = new(
id: "CMPS0008",
@@ -137,9 +128,6 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="WarpIds"/> usage.
/// <para>
/// Format: <c>"The WarpIds type is used in method {0} of type {1}"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidWarpIdsUsage = new(
id: "CMPS0009",
@@ -600,5 +588,37 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
isEnabledByDefault: true,
description: "The arguments in a swizzled indexer for a matrix type must be compile-time constants.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader constant property type.
/// <para>
/// Format: <c>"The compute shader of type {0} contains a constant property \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidShaderConstantPropertyType = new(
id: "CMPS0043",
title: "Invalid shader constant property type",
messageFormat: "The compute shader of type {0} contains a constant property \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)",
category: typeof(IComputeShader).FullName,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "A type representing a compute shader contains a constant property of a type that is not supported.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader constant property declaration.
/// <para>
/// Format: <c>"The compute shader of type {0} contains a constant property \"{1}\" with an invalid declaration (must use a lambda expression)"</c>.
/// </para>
/// </summary>
public static readonly DiagnosticDescriptor InvalidShaderConstantPropertyDeclaration = new(
id: "CMPS0044",
title: "Invalid shader constant property",
messageFormat: "The compute shader of type {0} contains a constant property \"{1}\" with an invalid declaration (must use a lambda expression)",
category: typeof(IComputeShader).FullName,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "A type representing a compute shader contains a constant property with an invalid declaration.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
}
}