mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +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 文件提供完整的项目介绍和使用指南
28 lines
867 B
C#
28 lines
867 B
C#
using Microsoft.CodeAnalysis;
|
|
|
|
namespace GFramework.SourceGenerators.diagnostics;
|
|
|
|
/// <summary>
|
|
/// 提供与上下文感知相关的诊断规则定义
|
|
/// </summary>
|
|
public static class ContextAwareDiagnostic
|
|
{
|
|
/// <summary>
|
|
/// 定义类必须实现IContextAware接口的诊断规则
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 诊断ID: GF_Rule_001
|
|
/// 诊断类别: GFramework.SourceGenerators.rule
|
|
/// 严重级别: 错误
|
|
/// 启用状态: true
|
|
/// 消息格式: "Class '{0}' must implement IContextAware"
|
|
/// </remarks>
|
|
public static readonly DiagnosticDescriptor ClassMustImplementIContextAware = new(
|
|
"GF_Rule_001",
|
|
"Class must implement IContextAware",
|
|
"Class '{0}' must implement IContextAware",
|
|
"GFramework.SourceGenerators.rule",
|
|
DiagnosticSeverity.Error,
|
|
true
|
|
);
|
|
} |