mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 ClassMustBePartial 诊断描述符移至 CommonDiagnostics 类 - 更新 GodotLoggerGenerator 和 LoggerGenerator 引用通用诊断 - 添加 ContextAwareGenerator 实现上下文感知功能 - 创建 ContextAwareAttribute 标记需要自动实现 IContextAware 的类 - 在项目中添加对 GFramework.SourceGenerators.Common 的引用 - 更新诊断规则 ID 命名规范 - 修复 AnalyzerReleases 文件格式 - 添加 nullable enable 配置 - 在解决方案文件中添加新项目引用
21 lines
693 B
C#
21 lines
693 B
C#
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);
|
||
} |