mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 添加 CommonDiagnostics 类提供通用诊断描述符 - 将诊断相关文件从 logging 目录移动到 diagnostics 目录 - 更新命名空间从 GFramework.SourceGenerators.Common.diagnostics 到 GFramework.SourceGenerators.diagnostics - 修改诊断ID从 GFC001 到 GF_Common_Class_001 - 移除 GFramework.SourceGenerators.Common 项目引用 - 更新 AnalyzerReleases.Unshipped.md 文件中的诊断规则 - 重构 README.md 文件提供完整的项目介绍和使用指南
29 lines
848 B
C#
29 lines
848 B
C#
using Microsoft.CodeAnalysis;
|
|
|
|
namespace GFramework.Godot.SourceGenerators.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
|
|
);
|
|
} |