diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs
index 8568b84a..8a98720b 100644
--- a/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs
+++ b/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs
@@ -46,6 +46,12 @@ partial class CanvasEffectPropertyGenerator
return false;
}
+ // Static properties are not supported
+ if (property.Modifiers.Any(SyntaxKind.StaticKeyword))
+ {
+ return false;
+ }
+
// The accessors must be a get and a set (with any accessibility)
if (accessors[0].Kind() is not (SyntaxKind.GetAccessorDeclaration or SyntaxKind.SetAccessorDeclaration) ||
accessors[1].Kind() is not (SyntaxKind.GetAccessorDeclaration or SyntaxKind.SetAccessorDeclaration))
@@ -128,6 +134,11 @@ partial class CanvasEffectPropertyGenerator
return CanvasEffectInvalidationType.Update;
}
+ ///
+ /// Writes all implementations of partial effect property declarations.
+ ///
+ /// The input set of declared effect properties.
+ /// The instance to write into.
public static void WritePropertyDeclarations(EquatableArray properties, IndentedTextWriter writer)
{
// Helper to get the nullable type name for the initial property value
diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
index 64e1c2f0..4a745df3 100644
--- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
+++ b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
@@ -80,7 +80,7 @@ internal static class DiagnosticDescriptors
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
///
- /// Gets a for a CanvasEffect property with invalid accessors.
+ /// Gets a for a CanvasEffect property that is not an incomplete partial property definition.
///
/// Format: "The property "{0}" is not an incomplete partial definition ([GeneratedCanvasEffectProperty] must be used on partial property definitions with no implementation part)".
///
@@ -92,11 +92,11 @@ internal static class DiagnosticDescriptors
category: DiagnosticCategory,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
- description: "A property using [GeneratedCanvasEffectProperty] is either not partial, or a partial implementation part ([GeneratedCanvasEffectProperty] must be used on partial property definitions with no implementation par).",
+ description: "A property using [GeneratedCanvasEffectProperty] is either not partial, or a partial implementation part ([GeneratedCanvasEffectProperty] must be used on partial property definitions with no implementation part).",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
///
- /// Gets a for a CanvasEffect property with invalid accessors.
+ /// Gets a for a CanvasEffect property that returns a ref value.
///
/// Format: "The property "{0}" returns a value by reference ([GeneratedCanvasEffectProperty] must be used on properties returning a type by value)".
///
@@ -112,7 +112,7 @@ internal static class DiagnosticDescriptors
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
///
- /// Gets a for a CanvasEffect property with invalid accessors.
+ /// Gets a for a CanvasEffect property that returns a byref-like value.
///
/// Format: "The property "{0}" returns a ref struct value ([GeneratedCanvasEffectProperty] must be used on properties with a type that is not a ref struct)".
///
@@ -128,7 +128,7 @@ internal static class DiagnosticDescriptors
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
///
- /// Gets a for a CanvasEffect property with invalid accessors.
+ /// Gets a for when C# is not set to 'preview'.
///
/// Format: "Using [GeneratedCanvasEffectProperty] requires the C# language version to be set to 'preview', as support for the 'field' keyword is needed by the source generators to emit valid code (add <LangVersion>preview</LangVersion> to your .csproj/.props file)".
///