GeWuYou 40a9b523f5 feat(rule): 添加上下文感知诊断规则
- 新增 GF_Rule_001 诊断规则,要求类必须实现 IContextAware 接口
- 创建 ContextAwareDiagnostic 类定义诊断规则元数据
- 修改 ContextAwareGenerator 实现 IContextAware 接口检查
- 优化生成器代码结构,添加候选类查找和输出生成功能
- 更新 AnalyzerReleases.Unshipped.md 文档
- 调整测试代码以适配新的诊断规则
- 修复日志诊断规则的命名空间大小写错误
2025-12-27 13:04:01 +08:00

21 lines
693 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.SourceGenerators.logging;
/// <summary>
/// 提供诊断描述符的静态类用于GFramework日志生成器的编译时检查
/// </summary>
internal static class LoggerDiagnostics
{
/// <summary>
/// 定义诊断描述符LogAttribute无法生成Logger的错误情况
/// </summary>
public static readonly DiagnosticDescriptor LogAttributeInvalid =
new(
"GF_Logging_001",
"LogAttribute cannot generate Logger",
"LogAttribute on class '{0}' is ineffective: {1}",
"GFramework.Godot.logging",
DiagnosticSeverity.Warning,
true);
}