From a42ec0c2829d22658c5339f3e7148d65c6305a75 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:31:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(generator):=20=E4=BF=AE=E5=A4=8D=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7=E7=94=9F=E6=88=90=E5=99=A8=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=85=B3=E9=94=AE=E5=AD=97=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将语法节点的部分关键字检查从 Any 操作改为 All 操作 - 修正了对非部分类的诊断报告条件判断 - 确保只有当所有修饰符都不是部分关键字时才报告错误 --- GFramework.SourceGenerators/Bases/PriorityGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GFramework.SourceGenerators/Bases/PriorityGenerator.cs b/GFramework.SourceGenerators/Bases/PriorityGenerator.cs index 941aa01..6298500 100644 --- a/GFramework.SourceGenerators/Bases/PriorityGenerator.cs +++ b/GFramework.SourceGenerators/Bases/PriorityGenerator.cs @@ -56,7 +56,7 @@ public sealed class PriorityGenerator : MetadataAttributeClassGeneratorBase } // 3. 必须是 partial - if (!syntax.Modifiers.Any(m => m.IsKind(SyntaxKind.PartialKeyword))) + if (syntax.Modifiers.All(m => !m.IsKind(SyntaxKind.PartialKeyword))) { context.ReportDiagnostic(Diagnostic.Create( PriorityDiagnostic.MustBePartial,