GeWuYou eb307bf188 feat(generator): 添加代码生成器诊断规则和测试用例
- 定义了 Godot 源代码生成器的诊断规则表格
- 添加了上下文获取生成器的全面单元测试
- 实现了自动生成行为和注册导出集合的诊断功能
- 配置了全局 using 语句简化代码生成器实现
- 添加了完整的分析器发布跟踪文档记录新规则
2026-04-13 10:01:46 +08:00

33 lines
1.1 KiB
C#

using GFramework.SourceGenerators.Common.Constants;
namespace GFramework.Godot.SourceGenerators.Diagnostics;
internal static class AutoBehaviorDiagnostics
{
private const string Category = $"{PathContests.GodotNamespace}.SourceGenerators.Behavior";
public static readonly DiagnosticDescriptor NestedClassNotSupported = new(
"GF_AutoBehavior_001",
"Auto behavior generators do not support nested classes",
"Generator '{0}' does not support nested class '{1}'",
Category,
DiagnosticSeverity.Error,
true);
public static readonly DiagnosticDescriptor MissingBaseType = new(
"GF_AutoBehavior_002",
"Auto behavior generators require a compatible base type",
"Type '{0}' must inherit from '{1}' to use '{2}'",
Category,
DiagnosticSeverity.Error,
true);
public static readonly DiagnosticDescriptor InvalidUiLayerName = new(
"GF_AutoBehavior_003",
"Unknown UiLayer name",
"Ui layer '{0}' on '{1}' does not exist on GFramework.Game.Abstractions.Enums.UiLayer",
Category,
DiagnosticSeverity.Error,
true);
}