GwWuYou a888e76842 refactor(source-generators): 提取通用诊断描述符并更新代码生成器
- 将 ClassMustBePartial 诊断描述符移至 CommonDiagnostics 类
- 更新 GodotLoggerGenerator 和 LoggerGenerator 引用通用诊断
- 添加 ContextAwareGenerator 实现上下文感知功能
- 创建 ContextAwareAttribute 标记需要自动实现 IContextAware 的类
- 在项目中添加对 GFramework.SourceGenerators.Common 的引用
- 更新诊断规则 ID 命名规范
- 修复 AnalyzerReleases 文件格式
- 添加 nullable enable 配置
- 在解决方案文件中添加新项目引用
2025-12-26 22:05:34 +08:00

25 lines
833 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.CodeAnalysis;
namespace GFramework.Godot.SourceGenerators.logging;
/// <summary>
/// 提供诊断描述符的静态类用于GFramework日志生成器的编译时检查
/// </summary>
internal static class GodotLoggerDiagnostics
{
/// <summary>
/// 诊断描述符标识GodotLogAttribute无法在指定类上生成Logger
/// </summary>
/// <remarks>
/// ID: GFW_LOG001
/// 严重性: Warning
/// 分类: GFramework.Godot.Logging
/// </remarks>
public static readonly DiagnosticDescriptor LogAttributeInvalid = new(
"GF_Godot_Logging_001",
"GodotLogAttribute cannot generate Logger",
"GodotLogAttribute on class '{0}' is ineffective: {1}",
"GFramework.Godot.Logging",
DiagnosticSeverity.Warning,
true);
}