mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
- 将 ClassMustBePartial 诊断描述符移至 CommonDiagnostics 类 - 更新 GodotLoggerGenerator 和 LoggerGenerator 引用通用诊断 - 添加 ContextAwareGenerator 实现上下文感知功能 - 创建 ContextAwareAttribute 标记需要自动实现 IContextAware 的类 - 在项目中添加对 GFramework.SourceGenerators.Common 的引用 - 更新诊断规则 ID 命名规范 - 修复 AnalyzerReleases 文件格式 - 添加 nullable enable 配置 - 在解决方案文件中添加新项目引用
29 lines
836 B
C#
29 lines
836 B
C#
using Microsoft.CodeAnalysis;
|
|
|
|
namespace GFramework.SourceGenerators.Common.diagnostics;
|
|
|
|
/// <summary>
|
|
/// 提供通用诊断描述符的静态类
|
|
/// </summary>
|
|
public static class CommonDiagnostics
|
|
{
|
|
/// <summary>
|
|
/// 定义类必须为partial的诊断描述符
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 诊断ID: GF001
|
|
/// 诊断消息: "Class '{0}' must be declared partial for code generation"
|
|
/// 分类: GFramework.Common
|
|
/// 严重性: Error
|
|
/// 是否启用: true
|
|
/// </remarks>
|
|
public static readonly DiagnosticDescriptor ClassMustBePartial =
|
|
new(
|
|
"GFC001",
|
|
"Class must be partial",
|
|
"Class '{0}' must be declared partial for code generation",
|
|
"GFramework.Common",
|
|
DiagnosticSeverity.Error,
|
|
true
|
|
);
|
|
} |