mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
refactor(ContextAwareGenerator): 移除接口实现检查逻辑
- 删除了对IContextAware接口实现的验证代码 - 简化了ContextAwareGenerator的检查逻辑 - 移除了相关的诊断报告功能
This commit is contained in:
parent
d73be1e15e
commit
af24a64d3b
@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using GFramework.Core.Abstractions.rule;
|
||||
using GFramework.SourceGenerators.Abstractions.rule;
|
||||
using GFramework.SourceGenerators.Common.constants;
|
||||
using GFramework.SourceGenerators.Common.generator;
|
||||
using GFramework.SourceGenerators.diagnostics;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
@ -33,16 +30,6 @@ public sealed class ContextAwareGenerator : AttributeClassGeneratorBase
|
||||
INamedTypeSymbol symbol,
|
||||
AttributeData attr)
|
||||
{
|
||||
if (!symbol.AllInterfaces.Any(i =>
|
||||
i.ToDisplayString() == typeof(IContextAware).FullName))
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
ContextAwareDiagnostic.ClassMustImplementIContextAware,
|
||||
syntax.Identifier.GetLocation(),
|
||||
symbol.Name));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user