mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-28 16:13:28 +08:00
- 移除ContextAwareServiceExtensions中GetService/GetSystem/GetModel/GetUtility方法的可空返回值 - 添加ContextGetGenerator源码生成器,支持通过特性自动生成上下文注入代码 - 新增GetService/GetServices/GetSystem/GetSystems/GetModel/GetModels/GetUtility/GetUtilities/GetAll特性 - 添加ContextGetDiagnostics提供注入相关的编译时诊断检查 - 实现INamedTypeSymbol扩展方法AreAllDeclarationsPartial用于检查partial类声明 - 添加ITypeSymbol扩展方法IsAssignableTo用于类型兼容性判断 - 创建FieldCandidateInfo和TypeCandidateInfo记录类型用于存储生成器候选信息 - 添加IsExternalInit内部类型支持低版本.NET框架的init-only setter功能 - 更新AnalyzerReleases.Unshipped.md添加新的诊断规则条目 - 创建完整的单元测试验证生成器功能和各种边界情况
9 lines
285 B
C#
9 lines
285 B
C#
namespace GFramework.SourceGenerators.Abstractions.Rule;
|
|
|
|
/// <summary>
|
|
/// 标记字段需要自动注入单个服务实例。
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
|
|
public sealed class GetServiceAttribute : Attribute
|
|
{
|
|
} |