mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将CommonDiagnostics移至GFramework.SourceGenerators.Common模块 - 添加PathContests常量类统一管理路径常量 - 更新GodotLoggerGenerator使用新的路径常量和诊断引用 - 修改项目引用以包含GFramework.SourceGenerators.Common依赖 - 更新NuGet包配置以包含Common模块的DLL和XML文档 - 在解决方案文件中添加GFramework.SourceGenerators.Common项目引用 - 为Common模块创建Analyzer发布跟踪文件
29 lines
849 B
C#
29 lines
849 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(
|
|
"GF_Common_Class_001",
|
|
"Class must be partial",
|
|
"Class '{0}' must be declared partial for code generation",
|
|
"GFramework.Common",
|
|
DiagnosticSeverity.Error,
|
|
true
|
|
);
|
|
} |