mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 02:24:30 +08:00
fix(generator): 修复优先级生成器中的部分关键字检查逻辑
- 将语法节点的部分关键字检查从 Any 操作改为 All 操作 - 修正了对非部分类的诊断报告条件判断 - 确保只有当所有修饰符都不是部分关键字时才报告错误
This commit is contained in:
parent
884249649d
commit
a42ec0c282
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user