Skip to content

docs(api): 添加 GFramework API 参考文档和源代码生成器文档#213

Merged
GeWuYou merged 4 commits into
mainfrom
docs/api-reference-and-generators
Apr 13, 2026
Merged

docs(api): 添加 GFramework API 参考文档和源代码生成器文档#213
GeWuYou merged 4 commits into
mainfrom
docs/api-reference-and-generators

Conversation

@GeWuYou

@GeWuYou GeWuYou commented Apr 13, 2026

Copy link
Copy Markdown
Owner
  • 新增 API 参考文档,包含核心命名空间、常用 API、游戏模块 API、Godot 集成 API
  • 详细介绍架构、模型、系统、命令、查询等核心类型及其用法示例
  • 添加本地化系统 API 文档,包含管理器、字符串、配置等相关接口
  • 新增源代码生成器完整文档,涵盖 Log、Config Schema、ContextAware 等生成器
  • 详细说明各生成器的使用方法、配置选项和诊断信息
  • 提供完整的 Godot 专用生成器文档,包括 GetNode、BindNodeSignal、AutoUiPage 等
  • 添加使用示例和最佳实践指南,展示完整的游戏控制器和枚举状态管理示例

Summary by CodeRabbit

发布说明

  • 文档
    • 扩展源码生成器 API 参考,新增四个生成器条目并补充“常用 Attribute”一节与跳转链接
    • 新增四篇专项文档,详述各生成器的声明式用法、生成行为、参数约束、诊断信息与示例调用建议
    • 更新源码生成器索引与目录,补充示例与对比说明,便于快速查阅与使用决策

- 新增 API 参考文档,包含核心命名空间、常用 API、游戏模块 API、Godot 集成 API
- 详细介绍架构、模型、系统、命令、查询等核心类型及其用法示例
- 添加本地化系统 API 文档,包含管理器、字符串、配置等相关接口
- 新增源代码生成器完整文档,涵盖 Log、Config Schema、ContextAware 等生成器
- 详细说明各生成器的使用方法、配置选项和诊断信息
- 提供完整的 Godot 专用生成器文档,包括 GetNode、BindNodeSignal、AutoUiPage 等
- 添加使用示例和最佳实践指南,展示完整的游戏控制器和枚举状态管理示例
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 86d798f0-3721-41a8-9eaf-5b99dbc20cb8

📥 Commits

Reviewing files that changed from the base of the PR and between 3d169ca and 0a7d4ad.

📒 Files selected for processing (1)
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
📜 Recent review details
🧰 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.md
{README.md,docs/**/*.md}

📄 CodeRabbit inference engine (AGENTS.md)

{README.md,docs/**/*.md}: Update the relevant README.md or docs/ 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.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.md
🧠 Learnings (2)
📓 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.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)

🔇 Additional comments (3)
docs/zh-CN/source-generators/auto-register-exported-collections-generator.md (3)

1-68: 文档质量优秀,示例完整准确

文档结构清晰,准确传达了生成器的核心价值:消除重复的集合遍历注册样板。基础使用示例涵盖了完整的类型定义与调用路径,特别值得肯定的是:

  • 使用 nameof(...) 引用成员与方法,提供编译期安全性
  • 明确说明注册器初始化时机,避免用户在 _Ready() 调用顺序上犯错
  • 示例代码与 context snippet 1-2 中的特性定义完全吻合

70-145: 生成代码示例与约束说明准确无误

生成的代码示例与源生成器逻辑完全一致,空值检查、遍历结构与方法调用均正确。支持的匹配规则部分准确描述了从接口继承链解析注册方法的能力,这对于理解 IAssetRegistry<T> 继承 IRegistry<TKey, TValue> 等架构模式至关重要。使用约束清单与源码中的诊断描述符一一对应。


146-174: 诊断表与调用时机建议完整可靠

诊断信息表准确列出全部 8 个生成器专用诊断 ID 及 2 个通用诊断,描述与源码中的 AutoRegisterExportedCollectionsDiagnostics 类完全一致。调用时机建议特别实用,明确指出不要在构造函数中调用的原因(Godot 导出字段未就绪),有助于避免运行时问题。

Line 155 的措辞已在之前的审阅中修正("被标记成员" → "被标记的成员"),当前文本符合技术文档表达规范。


📝 Walkthrough

Walkthrough

扩展并新增中文文档:在 API 参考中增加“源码生成器”与“常用 Attribute”条目,并新增四个源码生成器专题文档(AutoRegisterModule、AutoUiPage、AutoScene、AutoRegisterExportedCollections),说明用途、示例、生成代码结构、约束与诊断 ID 等细节。

Changes

Cohort / File(s) Summary
API 索引与参考
docs/zh-CN/api-reference/index.md, docs/zh-CN/source-generators/index.md
扩展生成器表与目录:在 API 参考加入“常用 Attribute”小节并新增 4 个生成器条目与锚点链接(AutoRegisterModule、AutoUiPage、AutoScene、AutoRegisterExportedCollections)。
新增生成器文档
docs/zh-CN/source-generators/auto-register-module-generator.md, docs/zh-CN/source-generators/auto-ui-page-generator.md, docs/zh-CN/source-generators/auto-scene-generator.md, docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
新增四篇源码生成器文档,分别说明 Attribute 用法、生成后的示例代码结构、参数/使用约束、诊断 ID 列表及推荐调用时机。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 分钟

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 标题准确反映了主要变更内容:添加 GFramework API 参考文档和源代码生成器文档,与提交内容完全相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/api-reference-and-generators

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f237ef and e691c9c.

📒 Files selected for processing (6)
  • docs/zh-CN/api-reference/index.md
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
  • docs/zh-CN/source-generators/auto-ui-page-generator.md
  • docs/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.md
  • docs/zh-CN/source-generators/index.md
  • docs/zh-CN/source-generators/auto-ui-page-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
{README.md,docs/**/*.md}

📄 CodeRabbit inference engine (AGENTS.md)

{README.md,docs/**/*.md}: Update the relevant README.md or docs/ 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.md
  • docs/zh-CN/source-generators/index.md
  • docs/zh-CN/source-generators/auto-ui-page-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
  • docs/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.md
  • docs/zh-CN/source-generators/index.md
  • docs/zh-CN/source-generators/auto-ui-page-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
  • docs/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.md
  • docs/zh-CN/source-generators/index.md
  • docs/zh-CN/source-generators/auto-ui-page-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
  • 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 **/*.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.md
  • 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 : EnumExtensionsGenerator must generate enum extension capabilities for enums decorated with [GenerateEnumExtensions] attribute

Applied to files:

  • docs/zh-CN/api-reference/index.md
  • 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 : 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 导航

这部分补充完整,和源码生成器文档页形成了可追踪的索引闭环。

Comment thread docs/zh-CN/source-generators/auto-scene-generator.md
@greptile-apps

greptile-apps Bot commented Apr 13, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 为 docs/zh-CN/ 下的文档站新增了四个源码生成器的完整说明页面(AutoRegisterModuleAutoUiPageAutoSceneAutoRegisterExportedCollections),并相应扩展了 source-generators/index.mdapi-reference/index.md 的入口章节。文档结构清晰,覆盖了概述、基础用法、生成代码示例、参数说明、约束条件和诊断 ID,符合框架其他生成器文档的既有风格。

主要问题均为文档层面的小型一致性或准确性问题:

  • 链接格式不一致:新增页面中的"完整文档"和"相关文档"链接均带有 .md 扩展名(如 ./auto-ui-page-generator.md),而仓库中已有的同类文档(get-node-generator.mdbind-node-signal-generator.md 等)的链接均不带扩展名。VitePress 两者均兼容,但建议统一风格。
  • 描述欠准确auto-ui-page-generator.md 中称 nameof(UiLayer.Page) "最终转成字符串常量",但生成代码实际将其解析为枚举成员 UiLayer.Page,并非字符串。
  • 示例不完整auto-register-exported-collections-generator.md 的基础示例未展示 _textureRegistry 的初始化来源;由于生成方法内有 null 保护,该字段为 null 时注册会被静默跳过,读者照搬示例时可能遇到困惑。

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

Filename Overview
docs/zh-CN/api-reference/index.md 扩展了源码生成器部分,新增了4个生成器的说明表格和常用 Attribute 一览,内容准确,交叉链接可解析
docs/zh-CN/source-generators/index.md 新增 AutoRegisterModule、AutoUiPage、AutoScene、AutoRegisterExportedCollections 四个生成器的目录条目、概述和基础示例,但新增"完整文档"链接带 .md 扩展名,与已有条目风格不一致
docs/zh-CN/source-generators/auto-register-module-generator.md 新增文件,覆盖了使用方式、生成代码示例、顺序规则、约束和诊断信息,内容完整;相关文档链接带 .md 扩展名与仓库既有风格不一致
docs/zh-CN/source-generators/auto-ui-page-generator.md 新增文件,文档结构完整,但"最终都会在编译期转成字符串常量"描述不准确(UiLayer 参数被解析为枚举值而非字符串常量),相关文档链接带 .md 扩展名
docs/zh-CN/source-generators/auto-scene-generator.md 新增文件,内容准确,生命周期边界说明清晰,与 AutoUiPage 的区别说明到位;相关文档链接带 .md 扩展名
docs/zh-CN/source-generators/auto-register-exported-collections-generator.md 新增文件,诊断表完整,支持场景说明充分;基础示例中 _textureRegistry 字段未展示初始化路径,可能让读者困惑为何注册被静默跳过

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
Loading

Reviews (1): Last reviewed commit: "docs(api): 添加 GFramework API 参考文档和源代码生成器..." | Re-trigger Greptile

Comment thread docs/zh-CN/source-generators/index.md Outdated
Comment thread docs/zh-CN/source-generators/auto-ui-page-generator.md
Comment thread docs/zh-CN/source-generators/auto-register-module-generator.md Outdated

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeWuYou has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

- 新增 AutoRegisterExportedCollections 生成器文档
- 新增 AutoRegisterModule 生成器文档
- 新增 AutoScene 生成器文档
- 新增 AutoUiPage 生成器文档
- 更新源码生成器总览索引文档
- 添加各生成器的使用示例和参数说明
- 补充诊断信息和使用约束说明

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeWuYou has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e691c9c and 3d169ca.

📒 Files selected for processing (5)
  • docs/zh-CN/source-generators/auto-register-exported-collections-generator.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
  • docs/zh-CN/source-generators/auto-ui-page-generator.md
  • docs/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.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
  • docs/zh-CN/source-generators/auto-scene-generator.md
{README.md,docs/**/*.md}

📄 CodeRabbit inference engine (AGENTS.md)

{README.md,docs/**/*.md}: Update the relevant README.md or docs/ 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.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
  • docs/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.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
  • docs/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.md
  • docs/zh-CN/source-generators/auto-register-module-generator.md
  • docs/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_GeneratedSceneKeyStr)、类型签名以及懒加载逻辑。完全限定的类型名称确保了代码在任何上下文中都能正确编译。

基于代码片段: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 的对比有助于开发者正确选择生成器

清晰区分了 AutoSceneAutoUiPage 在生成类型(ISceneBehavior vs IUiPageBehavior)和路由语义上的差异,并明确建议避免混用,有助于开发者根据实际场景选择合适的生成器。

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.csCommonDiagnostics.cs 核对),便于开发者理解和排查问题。


144-153: 注意事项和相关文档链接有价值!

注意事项部分提供了实用的提醒,避免生成器被误用。相关文档链接使用相对路径,符合文档组织结构。

Comment thread docs/zh-CN/source-generators/auto-register-exported-collections-generator.md Outdated
- 修正了 GF_AutoExport_004 错误消息描述中的措辞错误

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeWuYou has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@GeWuYou

GeWuYou commented Apr 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant