8 Commits

Author SHA1 Message Date
GwWuYou
02e2e31e95 feat(core): 添加上下文感知扩展方法并完善架构上下文接口
- 新增 ContextAwareExtensions 扩展类,提供便捷的上下文访问方法
- 为 IContextAware 接口添加 GetContext 方法以获取架构上下文
- 更新 ContextAwareBase 基类实现 GetContext 方法
- 改进源代码生成器的 Generate 方法参数结构
- 重构 ContextAwareGenerator 生成器实现接口方法自动实现
- 更新单元测试以验证新生成的上下文感知代码正确性
2025-12-29 20:06:25 +08:00
GwWuYou
75dfb0a942 refactor(generators): 重构枚举扩展生成器基类实现
- 将 EnumExtensionsGenerator 的基类从 MetadataAttributeClassGeneratorBase 改为 AttributeEnumGeneratorBase
- 修改 AttributeMetadataName 为静态私有字段
- 重写 ResolveAttribute 方法用于解析属性数据
- 更新 ValidateSymbol 方法参数类型为 EnumDeclarationSyntax
- 调整命名空间生成逻辑,简化条件判断
- 重构 AttributeEnumGeneratorBase 基类实现
- 添加 ResolveAttribute 抽象方法用于属性解析
- 改进 Initialize 方法中的语法提供程序逻辑
- 添加 GetHintName 虚方法用于生成文件名提示
2025-12-28 17:13:07 +08:00
GwWuYou
8b42c6c005 docs(generator): 更新AttributeClassGeneratorBase文档
- 添加编译对象参数说明
- [no tag]
2025-12-28 16:17:51 +08:00
GwWuYou
3262e111f4 refactor(generator): 重构源代码生成器基础类和诊断功能
- 为 ValidateSymbol 方法添加 Compilation 参数以支持类型解析
- 实现基于 Compilation 的接口类型验证,替代字符串比较方式
- 添加源代码生成器跟踪诊断功能,便于调试生成过程
- 在 AttributeClassGeneratorBase 中增加详细的执行流程跟踪日志
- 更新诊断描述符配置,添加跟踪信息的诊断支持
- 优化 ContextAwareGenerator 中的接口验证逻辑
2025-12-28 16:17:08 +08:00
GwWuYou
414e49c413 refactor(generators): 重构源代码生成器基类架构
- 将 AttributeClassGeneratorBase 抽象基类拆分为 MetadataAttributeClassGeneratorBase 和 TypeAttributeClassGeneratorBase
- 为 GodotLoggerGenerator 实现 TypeAttributeClassGeneratorBase 基类
- 为 EnumExtensionsGenerator 实现 MetadataAttributeClassGeneratorBase 基类
- 为 LoggerGenerator 实现 TypeAttributeClassGeneratorBase 基类
- 为 ContextAwareGenerator 实现 MetadataAttributeClassGeneratorBase 基类
- 添加 ContextAwareGenerator 中对 IContextAware 接口实现的验证逻辑
- 简化 AttributeClassGeneratorBase 中的语法提供程序实现
- 移除 AttributeClassGeneratorBase 中的异常处理和错误输出逻辑
- 优化属性解析机制,使用元数据名称或类型进行特性查找
2025-12-28 16:08:24 +08:00
GwWuYou
4172952b11 refactor(source-generators): 重构枚举扩展生成器和日志生成器
- 将 EnumExtensionsGenerator 从 IIncrementalGenerator 迁移到 AttributeClassGeneratorBase
- 将 LoggerGenerator 从 IIncrementalGenerator 迁移到 AttributeClassGeneratorBase
- 添加 AttributeEnumGeneratorBase 基类用于枚举相关生成器
- 更新依赖引用路径,使用新的抽象层和通用生成器基类
- 改进代码生成逻辑,使用强类型 Attribute 替代字符串匹配
- 添加详细的 XML 文档注释
- 修改项目目标框架为多版本支持 (net8.0;net9.0;net10.0)
2025-12-28 11:25:24 +08:00
GwWuYou
e4a317b743 style(generator): 格式化源代码生成器相关文件
- 修复 ILogger.cs 中多余的逗号
- 统一 ContextAwareDiagnostic.cs 中的注释缩进格式
- 统一 ContextAwareGenerator.cs 中的注释缩进格式
- 统一 ContextAwareAttribute.cs 中的注释缩进格式
- 统一 CommonDiagnostics.cs 中的注释缩进格式
- 简化 AttributeClassGeneratorBase.cs 中的 isEnabledByDefault 参数
- 统一 GeneratorTest.cs 中的注释缩进格式
- 优化 ContextAwareGeneratorTests.cs 中的代码结构
- 调整 AnalyzerReleases.Unshipped.md 中的表格格式
2025-12-28 10:50:41 +08:00
GwWuYou
2dea63e69f refactor(abstractions): 将抽象接口迁移至独立项目并更新引用
- 将架构相关接口从 GFramework.Core 迁移至 GFramework.Core.Abstractions 项目
- 更新项目引用配置,添加对抽象层项目的项目引用
- 修正命名空间引用,使用新的抽象层命名空间
- 调整类型定义,将 List<T> 替换为更通用的 IList<T> 接口
- 修复控制器接口命名空间错误
- 添加必要的 using 语句以支持新的抽象层引用
2025-12-28 10:37:18 +08:00