Check partial property syntax in generator

このコミットが含まれているのは:
Sergio Pedri committed 2024-10-17 21:41:43 -07:00
1 親 012d1b9d10
コミット bbb0134494
3ファイル変更
+15 -3

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

+7 -1
ファイルの表示
@@ -25,7 +25,13 @@ partial class CanvasEffectPropertyGenerator
public static bool IsCandidatePropertyDeclaration(SyntaxNode node, CancellationToken token)
{
// The node must be a property declaration with two accessors
if (node is not PropertyDeclarationSyntax { AccessorList.Accessors: { Count: 2 } accessors })
if (node is not PropertyDeclarationSyntax { AccessorList.Accessors: { Count: 2 } accessors } property)
{
return false;
}
// The property must be partial (we'll check that it's a declaration from its symbol)
if (!property.Modifiers.Any(SyntaxKind.PartialKeyword))
{
return false;
}