docs(api): 添加 GFramework API 参考文档和源代码生成器文档#213
Conversation
- 新增 API 参考文档,包含核心命名空间、常用 API、游戏模块 API、Godot 集成 API - 详细介绍架构、模型、系统、命令、查询等核心类型及其用法示例 - 添加本地化系统 API 文档,包含管理器、字符串、配置等相关接口 - 新增源代码生成器完整文档,涵盖 Log、Config Schema、ContextAware 等生成器 - 详细说明各生成器的使用方法、配置选项和诊断信息 - 提供完整的 Godot 专用生成器文档,包括 GetNode、BindNodeSignal、AutoUiPage 等 - 添加使用示例和最佳实践指南,展示完整的游戏控制器和枚举状态管理示例
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (3)docs/**/*📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{README.md,docs/**/*.md}📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/zh-CN/**/*.md📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2026-04-10T09:05:17.311ZApplied to files:
🪛 LanguageTooldocs/zh-CN/source-generators/auto-register-exported-collections-generator.md[uncategorized] ~9-~9: 数量词修饰并列短语,可能产生歧义 (s5) [uncategorized] ~155-~155: 能愿动词不能成为‘把’字句、‘被’字句的谓语动词。应该是:"可被……标记"。 (wa3) 🔇 Additional comments (3)
📝 WalkthroughWalkthrough扩展并新增中文文档:在 API 参考中增加“源码生成器”与“常用 Attribute”条目,并新增四个源码生成器专题文档(AutoRegisterModule、AutoUiPage、AutoScene、AutoRegisterExportedCollections),说明用途、示例、生成代码结构、约束与诊断 ID 等细节。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 分钟 Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/zh-CN/source-generators/auto-scene-generator.md`:
- Around line 19-23: The example uses the SceneKey enum but omits its namespace
import, causing copy-paste compilation failures; update the sample around the
AutoScene attribute on class GameplayRoot to either add the proper using for the
namespace that defines SceneKey (so SceneKey is resolved) or replace SceneKey
with its fully-qualified name in the AutoScene attribute to ensure the enum is
found.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 09aa4277-198c-473c-8b77-62c2a8c64229
📒 Files selected for processing (6)
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.mddocs/zh-CN/source-generators/auto-scene-generator.mddocs/zh-CN/source-generators/auto-ui-page-generator.mddocs/zh-CN/source-generators/index.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Code Quality & Security
- GitHub Check: Analyze (C#)
- GitHub Check: Build and Test
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Documentation must be located in docs/ directory with Chinese content in docs/zh-CN/
Files:
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/auto-ui-page-generator.mddocs/zh-CN/source-generators/auto-scene-generator.mddocs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.md
{README.md,docs/**/*.md}
📄 CodeRabbit inference engine (AGENTS.md)
{README.md,docs/**/*.md}: Update the relevantREADME.mdordocs/page when behavior, setup steps, architecture guidance, or user-facing examples change
Keep code samples, package names, and command examples aligned with the current repository state
Prefer documenting behavior and design intent, not only API surface
For integration-oriented features such as AI-First config system, documentation MUST cover project directory layout, file conventions, required project/package wiring, minimal working usage example, and migration/compatibility notes
If an existing documentation page no longer reflects the current implementation, fixing the code without fixing the documentation is considered incomplete work
Do not rely on 'the code is self-explanatory' for framework features that consumers need to adopt; write the adoption path down so future users do not need to rediscover it from source
Files:
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/auto-ui-page-generator.mddocs/zh-CN/source-generators/auto-scene-generator.mddocs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.md
docs/zh-CN/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in
docs/zh-CN/in the same change
Files:
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/auto-ui-page-generator.mddocs/zh-CN/source-generators/auto-scene-generator.mddocs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.md
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change
📚 Learning: 2026-04-10T09:05:17.311Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change
Applied to files:
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/auto-ui-page-generator.mddocs/zh-CN/source-generators/auto-scene-generator.mddocs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.md
📚 Learning: 2026-04-10T09:05:17.311Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to **/*.cs : Any change to public API, lifecycle semantics, module behavior, or extension points MUST update the related XML docs
Applied to files:
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.md
📚 Learning: 2026-04-05T15:30:46.211Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-05T15:30:46.211Z
Learning: Applies to **/*.cs : EnumExtensionsGenerator must generate enum extension capabilities for enums decorated with [GenerateEnumExtensions] attribute
Applied to files:
docs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.md
📚 Learning: 2026-04-05T15:30:46.211Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-05T15:30:46.211Z
Learning: Applies to **/*.cs : LoggerGenerator must automatically generate log fields and logging helper methods for classes decorated with [Log] attribute
Applied to files:
docs/zh-CN/api-reference/index.md
📚 Learning: 2026-04-10T09:05:17.311Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to **/*.Tests.cs : Source generator changes MUST be covered by generator tests
Applied to files:
docs/zh-CN/source-generators/index.md
📚 Learning: 2026-04-05T15:30:46.211Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-05T15:30:46.211Z
Learning: Applies to **/*.cs : ContextAwareGenerator must automatically implement IContextAware boilerplate logic for classes decorated with [ContextAware] attribute
Applied to files:
docs/zh-CN/source-generators/index.md
🪛 LanguageTool
docs/zh-CN/source-generators/auto-scene-generator.md
[uncategorized] ~7-~7: 您的意思是“由"于"”吗?
Context: ... ## 概述 AutoScene 面向 GFramework 的场景路由与场景行为包装场景。 对于一个可切换、可识别的场景根节点,开发者通常需要重复声明:...
(YU7_YU8)
docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
[uncategorized] ~9-~9: 数量词修饰并列短语,可能产生歧义
Context: ...述 在游戏启动入口中,常见的一类样板是: - 在 Inspector 中导出一批配置、资源映射或预制体条目 - 从某个 Registry 成员拿到注册器 - 遍历集合...
(s5)
[uncategorized] ~143-~143: 能愿动词不能成为‘把’字句、‘被’字句的谓语动词。应该是:"可被……标记"。
Context: ... | | GF_AutoExport_004 | 被标记成员不是可枚举集合 ...
(wa3)
docs/zh-CN/source-generators/auto-register-module-generator.md
[uncategorized] ~126-~126: 您不可用“是”来表达个形容词。大部分人都平常用“很”来代替“是”。您是不是想表达"很抽象"?
Context: ...Install(IArchitecture)- 注册类型必须是具体类型,不能是抽象类或接口 - 注册类型必须实现对应接口: -RegisterMode...
(SHI_ADHECTIVE_ERROR)
🔇 Additional comments (2)
docs/zh-CN/source-generators/index.md (1)
18-23: 新增生成器索引与落地页面链接组织清晰目录、概览与详细入口保持一致,能直接支持新生成器的发现与采用路径。
Also applies to: 473-614
docs/zh-CN/api-reference/index.md (1)
443-464: API 参考页已补齐新生成器与常用 Attribute 导航这部分补充完整,和源码生成器文档页形成了可追踪的索引闭环。
Greptile Summary本 PR 为 主要问题均为文档层面的小型一致性或准确性问题:
Confidence Score: 4/5纯文档 PR,无代码逻辑变更,可安全合并;建议在合并前修复链接扩展名不一致和 UiLayer 描述不准确两处小问题。 本 PR 仅新增文档,不涉及任何运行时代码变更,无安全或功能风险。文档内容结构完整,诊断表、示例代码和约束说明均到位。扣分原因是四个新文件及其在 index.md 中的链接格式与现有文件不一致,以及 auto-ui-page-generator.md 中关于 UiLayer 参数的描述存在技术细节偏差,这些问题修复成本低,属于锦上添花的改进。 重点关注 docs/zh-CN/source-generators/auto-ui-page-generator.md(描述准确性)和 docs/zh-CN/source-generators/index.md(链接一致性)。 Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[source-generators/index.md] -->|新增目录入口| B[AutoRegisterModule 生成器]
A -->|新增目录入口| C[AutoUiPage 生成器]
A -->|新增目录入口| D[AutoScene 生成器]
A -->|新增目录入口| E[AutoRegisterExportedCollections 生成器]
B -->|完整文档| B2[auto-register-module-generator.md]
C -->|完整文档| C2[auto-ui-page-generator.md]
D -->|完整文档| D2[auto-scene-generator.md]
E -->|完整文档| E2[auto-register-exported-collections-generator.md]
F[api-reference/index.md] -->|支持的生成器 & 常用 Attribute 表格| B2
F -->|支持的生成器 & 常用 Attribute 表格| C2
F -->|支持的生成器 & 常用 Attribute 表格| D2
F -->|支持的生成器 & 常用 Attribute 表格| E2
B2 -->|相关文档| A
C2 -->|相关文档| A
D2 -->|相关文档| A
E2 -->|相关文档| A
C2 <-->|区别说明| D2
Reviews (1): Last reviewed commit: "docs(api): 添加 GFramework API 参考文档和源代码生成器..." | Re-trigger Greptile |
There was a problem hiding this comment.
GeWuYou has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
- 新增 AutoRegisterExportedCollections 生成器文档 - 新增 AutoRegisterModule 生成器文档 - 新增 AutoScene 生成器文档 - 新增 AutoUiPage 生成器文档 - 更新源码生成器总览索引文档 - 添加各生成器的使用示例和参数说明 - 补充诊断信息和使用约束说明
There was a problem hiding this comment.
GeWuYou has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/zh-CN/source-generators/auto-scene-generator.md (1)
7-7: 修正句子结构中的冗余表述当前句子"面向 GFramework 的场景路由与场景行为包装场景"在末尾重复了"场景"一词,语义不够清晰。建议改为"面向 GFramework 的场景路由与场景行为包装"。
♻️ 建议修改
-`AutoScene` 面向 GFramework 的场景路由与场景行为包装场景。 +`AutoScene` 面向 GFramework 的场景路由与场景行为包装。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/zh-CN/source-generators/auto-scene-generator.md` at line 7, The sentence for AutoScene currently reads "面向 GFramework 的场景路由与场景行为包装场景" which redundantly repeats "场景"; update the text that mentions AutoScene to "面向 GFramework 的场景路由与场景行为包装" (remove the trailing "场景") so the description is concise and clear; locate the line containing the AutoScene description and replace the phrase accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@docs/zh-CN/source-generators/auto-register-exported-collections-generator.md`:
- Line 155: Update the diagnostic message for code `GF_AutoExport_004` to use a
more natural Chinese phrasing: replace "被标记成员不是可枚举集合" with either
"被标记的成员不是可枚举集合" or "标记的成员必须是可枚举集合" in the generator/diagnostics source where
`GF_AutoExport_004` is defined so the message reads naturally in the
documentation and tooling.
---
Nitpick comments:
In `@docs/zh-CN/source-generators/auto-scene-generator.md`:
- Line 7: The sentence for AutoScene currently reads "面向 GFramework
的场景路由与场景行为包装场景" which redundantly repeats "场景"; update the text that mentions
AutoScene to "面向 GFramework 的场景路由与场景行为包装" (remove the trailing "场景") so the
description is concise and clear; locate the line containing the AutoScene
description and replace the phrase accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 34ac11b8-f1fd-4fee-82ab-04cc6ee60e08
📒 Files selected for processing (5)
docs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.mddocs/zh-CN/source-generators/auto-scene-generator.mddocs/zh-CN/source-generators/auto-ui-page-generator.mddocs/zh-CN/source-generators/index.md
✅ Files skipped from review due to trivial changes (2)
- docs/zh-CN/source-generators/index.md
- docs/zh-CN/source-generators/auto-ui-page-generator.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (C#)
- GitHub Check: Build and Test
- GitHub Check: Code Quality & Security
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Documentation must be located in docs/ directory with Chinese content in docs/zh-CN/
Files:
docs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.mddocs/zh-CN/source-generators/auto-scene-generator.md
{README.md,docs/**/*.md}
📄 CodeRabbit inference engine (AGENTS.md)
{README.md,docs/**/*.md}: Update the relevantREADME.mdordocs/page when behavior, setup steps, architecture guidance, or user-facing examples change
Keep code samples, package names, and command examples aligned with the current repository state
Prefer documenting behavior and design intent, not only API surface
For integration-oriented features such as AI-First config system, documentation MUST cover project directory layout, file conventions, required project/package wiring, minimal working usage example, and migration/compatibility notes
If an existing documentation page no longer reflects the current implementation, fixing the code without fixing the documentation is considered incomplete work
Do not rely on 'the code is self-explanatory' for framework features that consumers need to adopt; write the adoption path down so future users do not need to rediscover it from source
Files:
docs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.mddocs/zh-CN/source-generators/auto-scene-generator.md
docs/zh-CN/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in
docs/zh-CN/in the same change
Files:
docs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.mddocs/zh-CN/source-generators/auto-scene-generator.md
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change
📚 Learning: 2026-04-10T09:05:17.311Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change
Applied to files:
docs/zh-CN/source-generators/auto-register-exported-collections-generator.mddocs/zh-CN/source-generators/auto-register-module-generator.mddocs/zh-CN/source-generators/auto-scene-generator.md
📚 Learning: 2026-04-05T15:30:46.211Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-05T15:30:46.211Z
Learning: Applies to docs/**/* : Documentation must be located in docs/ directory with Chinese content in docs/zh-CN/
Applied to files:
docs/zh-CN/source-generators/auto-register-module-generator.md
📚 Learning: 2026-04-10T09:05:17.311Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T09:05:17.311Z
Learning: Applies to {README.md,docs/**/*.md} : If an existing documentation page no longer reflects the current implementation, fixing the code without fixing the documentation is considered incomplete work
Applied to files:
docs/zh-CN/source-generators/auto-register-module-generator.md
🪛 LanguageTool
docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
[uncategorized] ~9-~9: 数量词修饰并列短语,可能产生歧义
Context: ...述 在游戏启动入口中,常见的一类样板是: - 在 Inspector 中导出一批配置、资源映射或预制体条目 - 从某个 Registry 成员拿到注册器 - 遍历集合...
(s5)
[uncategorized] ~155-~155: 能愿动词不能成为‘把’字句、‘被’字句的谓语动词。应该是:"可被……标记"。
Context: ... | | GF_AutoExport_004 | 被标记成员不是可枚举集合 ...
(wa3)
docs/zh-CN/source-generators/auto-register-module-generator.md
[uncategorized] ~126-~126: 您不可用“是”来表达个形容词。大部分人都平常用“很”来代替“是”。您是不是想表达"很抽象"?
Context: ...Install(IArchitecture)- 注册类型必须是具体类型,不能是抽象类或接口 - 注册类型必须实现对应接口: -RegisterMode...
(SHI_ADHECTIVE_ERROR)
docs/zh-CN/source-generators/auto-scene-generator.md
[uncategorized] ~7-~7: 您的意思是“由"于"”吗?
Context: ... ## 概述 AutoScene 面向 GFramework 的场景路由与场景行为包装场景。 对于一个可切换、可识别的场景根节点,开发者通常需要重复声明:...
(YU7_YU8)
🔇 Additional comments (14)
docs/zh-CN/source-generators/auto-register-exported-collections-generator.md (1)
1-174: 文档结构和覆盖面很好,符合本次特性落地预期示例、约束、诊断 ID、调用时机都比较完整,且与生成器使用路径一致,便于用户直接落地。
Based on learnings: "Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in
docs/zh-CN/in the same change"docs/zh-CN/source-generators/auto-scene-generator.md (7)
16-31: 基础使用示例完整且准确示例代码已包含所有必需的命名空间导入,
[AutoScene]特性使用了推荐的nameof()方式,并在_Ready()中正确调用GetScene()方法。代码结构清晰,可直接复制使用。
33-51: 生成代码示例准确反映实际输出展示的生成代码与源码生成器的实际输出模式一致,包含正确的成员名称(
__autoSceneBehavior_Generated、SceneKeyStr)、类型签名以及懒加载逻辑。完全限定的类型名称确保了代码在任何上下文中都能正确编译。基于代码片段:AutoSceneGenerator.cs 中定义的 GeneratedMemberNames 与文档示例完全匹配。
53-61: 参数说明简洁明确参数表格清晰展示了
[AutoScene]接收的单个字符串参数,并正确推荐使用nameof()而非硬编码字符串字面量,符合类型安全的最佳实践。
78-85: 使用约束覆盖全面且与诊断系统对应文档列出的所有约束都与源码生成器的实际验证逻辑一致,包括
partial class要求、禁止嵌套类、必须继承Godot.Node以及避免成员名冲突。这些约束均有对应的诊断 ID 支持。基于代码片段:AutoBehaviorDiagnostics.cs 定义的诊断 ID 与文档约束条目匹配。
97-107: 诊断信息表格完整且描述准确文档提供的诊断 ID 与源码生成器的实际诊断定义一致,涵盖了所有主要约束违规场景(非
partial类、成员冲突、嵌套类、缺少基类、无效参数)。每个诊断 ID 都配有清晰的中文说明。基于代码片段:AutoBehaviorDiagnostics.cs 中的诊断描述符与文档表格条目匹配。
86-95: 生命周期边界说明清晰设定了生成器职责范围通过明确列出
AutoScene不会生成或修改的生命周期方法(_Ready()、_EnterTree()、_ExitTree()等),帮助开发者理解生成器仅提供行为访问入口而不干预节点生命周期管理,避免了对生成器能力的误解。
109-114: 与 AutoUiPage 的对比有助于开发者正确选择生成器清晰区分了
AutoScene和AutoUiPage在生成类型(ISceneBehaviorvsIUiPageBehavior)和路由语义上的差异,并明确建议避免混用,有助于开发者根据实际场景选择合适的生成器。docs/zh-CN/source-generators/auto-register-module-generator.md (6)
1-24: 文档结构清晰,概述部分表述准确!标题、概述和核心收益部分很好地解释了
AutoRegisterModule生成器的用途和价值,内容组织合理。
25-72: 代码示例完整且准确!基础使用示例和生成代码示例都很清晰,展示了完整的使用流程。代码中正确使用了
global::限定符以避免命名冲突,符合生成器最佳实践。
74-97: 参数说明文档完整!各个特性(Attribute)的参数说明清晰,表格格式统一,便于查阅。
98-120: 顺序规则和适用场景说明实用!顺序规则部分清晰说明了注册顺序的确定性,适用场景部分提供了很好的实践指导,帮助开发者判断何时使用生成器。
121-143: 约束和诊断信息准确且完整!使用约束列表全面,诊断信息表与源代码中的诊断定义完全匹配(已与
AutoRegisterModuleDiagnostics.cs和CommonDiagnostics.cs核对),便于开发者理解和排查问题。
144-153: 注意事项和相关文档链接有价值!注意事项部分提供了实用的提醒,避免生成器被误用。相关文档链接使用相对路径,符合文档组织结构。
- 修正了 GF_AutoExport_004 错误消息描述中的措辞错误
There was a problem hiding this comment.
GeWuYou has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary by CodeRabbit
发布说明