mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
- 定义了 Godot 源代码生成器的诊断规则表格 - 添加了上下文获取生成器的全面单元测试 - 实现了自动生成行为和注册导出集合的诊断功能 - 配置了全局 using 语句简化代码生成器实现 - 添加了完整的分析器发布跟踪文档记录新规则
33 lines
1.1 KiB
C#
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);
|
|
}
|