Feat/godot source generators project metadata#217
Conversation
- 实现 project.godot 文件解析功能,支持 AutoLoad 和 Input Action 元数据提取 - 生成 AutoLoads 强类型访问入口,提供 GetRequiredNode 和 TryGetNode 方法 - 生成 InputActions 常量类,避免手写字符串魔法值 - 添加 AutoLoadAttribute 特性支持显式类型映射声明 - 实现标识符冲突检测和自动后缀追加机制 - 添加完整的诊断系统支持,包括类型继承检查和重复条目警告 - 创建 MSBuild 集成目标文件确保生成器正确加载 - 提供详细的 README 文档说明使用方法和最佳实践
- 新增.vitepress/config.mts配置文件,包含本地搜索、代码块保护等功能 - 添加API参考文档,涵盖核心架构、事件系统、属性系统等完整API - 添加源码生成器文档,介绍Log、ContextAware、EnumExtensions等生成器用法 - 配置多语言导航和侧边栏结构,完善文档站点设置 - 添加代码示例和使用指南,提供完整的框架使用参考
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.
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
📝 WalkthroughWalkthrough新增 Godot 项目元数据增量源生成器:从 Changes
Sequence Diagram(s)sequenceDiagram
participant Build as "MSBuild / Compiler"
participant Generator as "GodotProjectMetadataGenerator"
participant Files as "AdditionalFiles (project.godot)"
participant Semantic as "Roslyn Compilation / SemanticModel"
participant Diagnostics as "Diagnostics"
participant Output as "Generated Sources"
Build->>Generator: 初始化增量生成器(传入 AdditionalFiles、Compilation)
Generator->>Files: 查找并读取 `project.godot`
Generator->>Semantic: 解析并匹配类型候选(显式 `[AutoLoad]` 与隐式匹配)
Semantic-->>Generator: 返回 INamedTypeSymbol 候选与继承信息
Generator->>Diagnostics: 验证冲突/重复/继承规则并报告诊断
Generator->>Output: 生成 `AutoLoads.g.cs` 与 `InputActions.g.cs`
Generator-->>Build: 返回生成结果(包含 Diagnostics 与 生成源)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 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/tutorials/godot-integration.md`:
- Line 1357: 更新文档中的“**更新日期**”字段未随本次改动同步;请在
docs/zh-CN/tutorials/godot-integration.md 中找到标识为 “**更新日期**”
的条目并把日期更新为本次提交/改动的实际日期(使用 YYYY-MM-DD 格式),确保与本次 PR 的变更时间一致以避免读者误判时效性。
In `@GFramework.Godot.SourceGenerators.Abstractions/AutoLoadAttribute.cs`:
- Around line 21-24: The AutoLoadAttribute constructor currently only rejects
null but allows empty or whitespace names; update the AutoLoadAttribute(string
name) constructor to validate using string.IsNullOrWhiteSpace(name) and throw an
appropriate ArgumentException (with nameof(name) and a clear message) if the
value is empty/whitespace, and keep assigning to the Name property only after
this validation so invalid names are rejected early in code generation paths.
In
`@GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.cs`:
- Around line 64-70: The NormalizeLineEndings method currently re-introduces
platform-dependent endings by replacing '\n' with Environment.NewLine; change it
to produce a deterministic, platform-independent newline (e.g., always '\n') by
removing the final Replace call so the method normalizes CRLF and CR into '\n'
and returns that consistent result (update the NormalizeLineEndings method and
any related tests/snapshots to expect '\n').
In
`@GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs`:
- Around line 15-318: Add missing regression tests covering diagnostics
GF_Godot_Project_002, GF_Godot_Project_003, GF_Godot_Project_005,
GF_Godot_Project_006 and the branch where an implicitly same-named type falls
back to Godot.Node by adding new NUnit test methods in
GodotProjectMetadataGeneratorTests that call
AdditionalTextGeneratorTestDriver.Run<GodotProjectMetadataGenerator> with
crafted source/project.godot inputs to trigger each diagnostic and the fallback
behavior; for each new test assert the result.Results.Single().Diagnostics
contains the expected diagnostic Id and severity and validate generatedSources
(via AdditionalTextGeneratorTestDriver.ToGeneratedSourceMap) contains the
expected suffixing/degeneration output (e.g. constants with appended suffixes or
AutoLoad typed as global::Godot.Node) while following the existing test patterns
and naming conventions (e.g.,
Run_Should_Report_Diagnostic_For_GF_Godot_Project_00X and
Run_Should_Degrade_To_Godot_Node_When_Implicit_Name_Collides).
In
`@GFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targets`:
- Line 11: The generator currently hardcodes Path.GetFileName(...) ==
"project.godot" in GodotProjectMetadataGenerator.cs so a renamed
GFrameworkGodotProjectFile added to AdditionalFiles is ignored; update the
generator to read the configured filename from AnalyzerConfig (use
AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.GFrameworkGodotProjectFile",
out var cfg) or a dedicated analyzer config key) and use that value when
matching AdditionalFiles (falling back to "project.godot" if the config is
absent), i.e., replace the literal comparison with a variable
(configuredFileName) resolved from AnalyzerConfigOptionsProvider and ensure
AdditionalFiles enumeration compares Path.GetFileName(file.Path) against
configuredFileName.
In `@GFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs`:
- Around line 204-210: The current logic silently downgrades to Godot.Node when
multiple implicit candidates with the same simple name exist (see
implicitCandidates.TryGetValue, DistinctTypeSymbols and resolvedMappings), so
update the generator to emit the GF_Godot_Project_002 diagnostic when
distinctImplicitTypes.Length > 1 (same diagnostic used for explicit [AutoLoad]
conflicts) instead of silently skipping; include the projectAutoLoadName and the
conflicting symbol names in the diagnostic payload so the generated output
explains the fallback and references the two (or more) distinct type symbols
that caused the ambiguity.
- Around line 127-130: The call to the IsAssignableTo extension method on
typeSymbol (used to compute derivesFromNode against godotNodeSymbol) is
unresolved because the GFramework.SourceGenerators.Common.Extensions namespace
is not imported; add "using GFramework.SourceGenerators.Common.Extensions;" at
the top of GodotProjectMetadataGenerator.cs (or add it as a global using in
GlobalUsings.cs) so the IsAssignableTo extension is discovered by the compiler.
- Around line 1-3: 该文件在实现中直接使用了
Path、SourceText、TextSpan、LinePosition、LinePositionSpan
等类型但头部只引入了两个命名空间,导致编译失败;请在 GodotProjectMetadataGenerator.cs 顶部显式补上所需的 using
声明(至少包含 System.IO 以访问 Path,Microsoft.CodeAnalysis 和 Microsoft.CodeAnalysis.Text
以访问 SourceText、TextSpan、LinePosition、LinePositionSpan 等符号),确保不依赖隐式导入且能解析上述类型引用。
🪄 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: d93a1cab-7489-43cf-ad79-d603ca09dbf5
📒 Files selected for processing (14)
AGENTS.mdGFramework.Godot.SourceGenerators.Abstractions/AutoLoadAttribute.csGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/AnalyzerReleases.Unshipped.mdGFramework.Godot.SourceGenerators/Diagnostics/GodotProjectDiagnostics.csGFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targetsGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.csGFramework.Godot.SourceGenerators/README.mddocs/.vitepress/config.mtsdocs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/godot-project-generator.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/tutorials/godot-integration.md
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality & Security
- GitHub Check: Analyze (C#)
🧰 Additional context used
📓 Path-based instructions (6)
docs/**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Documentation must be located in docs/ directory with Chinese content in docs/zh-CN/
Files:
docs/zh-CN/tutorials/godot-integration.mddocs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/godot-project-generator.md
{README.md,docs/**/*.md,docs/zh-CN/**/*.md}
📄 CodeRabbit inference engine (AGENTS.md)
Update the relevant
README.mdordocs/page when behavior, setup steps, architecture guidance, or user-facing examples changeKeep 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 the AI-First config system, documentation MUST cover: project directory layout and file conventions, required project or package wiring, minimal working usage example, migration or compatibility notes when behavior changes
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/tutorials/godot-integration.mddocs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/godot-project-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/tutorials/godot-integration.mddocs/zh-CN/api-reference/index.mddocs/zh-CN/source-generators/index.mddocs/zh-CN/source-generators/godot-project-generator.md
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: LoggerGenerator must automatically generate log fields and logging helper methods for classes decorated with [Log] attribute
PriorityGenerator must generate priority comparison implementations for classes decorated with [Priority] attribute
EnumExtensionsGenerator must generate enum extension capabilities for enums decorated with [GenerateEnumExtensions] attribute
ContextAwareGenerator must automatically implement IContextAware boilerplate logic for classes decorated with [ContextAware] attributeAll public, protected, and internal types and members MUST include XML documentation comments (
///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicableComments must explain intent, contract, and usage constraints instead of restating syntax in XML documentation
If a member participates in lifecycle, threading, registration, or disposal behavior, document that behavior explicitly in XML documentation
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds/compatibility constraints, or edge cases
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why the abstraction exists, and when to use it instead of alternatives
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling, if any
Avoid obvious comments such as
// increment iComments MUST NOT be trivial, redundant, or misleading
Prefer explaining
whyandwhen, not justwhatin commentsPrefer slightly more explanation over too little for framework code
Do not rely on implicit imports. Declare every requi...
Files:
GFramework.Godot.SourceGenerators.Abstractions/AutoLoadAttribute.csGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators/Diagnostics/GodotProjectDiagnostics.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
**/*.SourceGenerators.Tests/**/*.cs
📄 CodeRabbit inference engine (AGENTS.md)
Source generator changes MUST be covered by generator tests
Preserve snapshot-based verification patterns already used in the repository for source generator tests
When generator behavior changes intentionally, update snapshots together with the implementation
Files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
**/*.SourceGenerators/*.cs
📄 CodeRabbit inference engine (AGENTS.md)
Keep source generators deterministic and free of hidden environment or network dependencies
Files:
GFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Before choosing runtimes or CLI tools, read `@.ai/environment/tools.ai.yaml`
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Use `@.ai/environment/tools.raw.yaml` only when you need the full collected facts behind the AI-facing hints
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Prefer the project-relevant tools listed in the environment inventory instead of assuming every installed system tool is fair game
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: When working in WSL against this repository's Windows-backed worktree, prefer Windows Git from WSL (for example `git.exe`) instead of the Linux `git` binary
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Use subagents only when the task is complex, the context is likely to grow too large, or the work can be split into independent parallel subtasks
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: The main agent MUST identify the critical path first. Do not delegate the immediate blocking task if the next local step depends on that result
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Use `explorer` subagents for read-only discovery, comparison, tracing, and narrow codebase questions
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Use `worker` subagents only for bounded implementation tasks with an explicit file or module ownership boundary
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Prefer lightweight models such as `gpt-5.1-codex-mini` for narrow exploration, indexing, and comparison tasks
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Prefer stronger models such as `gpt-5.4` for cross-module design work, non-trivial refactors, and tasks that require higher confidence reasoning
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Code should remain understandable without requiring external context
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Missing required documentation is a coding standards violation
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Code that does not meet the documentation rules is considered incomplete
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Keep abstractions projects free of implementation details and engine-specific dependencies
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Preserve existing module boundaries. Do not introduce new cross-module dependencies without clear architectural need
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Public API changes must be covered by unit or integration tests
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Run targeted tests for the code you changed whenever possible
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Run broader solution-level validation for changes that touch shared abstractions, lifecycle behavior, source generators, or dependency wiring
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Do not claim completion if required tests were skipped; state what was not run and why
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Completing code changes without updating the active tracking document is considered incomplete work
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: The main documentation site lives under `docs/`, with Chinese content under `docs/zh-CN/`
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: If an existing documentation page no longer reflects the current implementation, fixing the code without fixing the documentation is considered incomplete work
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T00:23:59.723Z
Learning: Before considering work complete, confirm: Required comments and XML docs are present, Code follows repository style and naming rules, Relevant tests were added or updated, Sensitive or unsafe behavior was not introduced, User-facing documentation is updated when needed, Feature adoption docs under `docs/zh-CN/` were added or updated when functionality was added, removed, or refactored
📚 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/.vitepress/config.mtsdocs/zh-CN/source-generators/index.mdGFramework.Godot.SourceGenerators/README.mddocs/zh-CN/source-generators/godot-project-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: Follow all coding rules defined in AGENTS.md
Applied to files:
AGENTS.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 : Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, compatibility constraints, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Applied to files:
AGENTS.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:
GFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targetsGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators/Diagnostics/GodotProjectDiagnostics.csdocs/zh-CN/source-generators/godot-project-generator.mdGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
📚 Learning: 2026-04-06T12:45:47.739Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:47.739Z
Learning: In the GFramework repository (GeWuYou/GFramework), even though `ImplicitUsings` is disabled in the `.csproj` files, the project uses a manual `GlobalUsings.cs` file with `global using` directives to provide common System namespaces (e.g., System, System.Threading, System.Threading.Tasks) project-wide. Do not flag missing System-level `using` imports in C# files within this repository, as they are covered by GlobalUsings.cs.
Applied to files:
GFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targets
📚 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 **/*.csproj : Follow repository defaults: `ImplicitUsings` disabled, `Nullable` enabled, `GenerateDocumentationFile` enabled for shipped libraries, `LangVersion` generally `preview` in main libraries
Applied to files:
GFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targets
📚 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 : Keep source generators deterministic and free of hidden environment or network dependencies
Applied to files:
GFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targetsGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators/Diagnostics/GodotProjectDiagnostics.csGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
📚 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 : When generator behavior changes intentionally, update snapshots together with the implementation
Applied to files:
docs/zh-CN/source-generators/index.mdGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Godot.SourceGenerators.Abstractions/AutoLoadAttribute.csGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators/Diagnostics/GodotProjectDiagnostics.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
📚 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 : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Public API changes must be covered by unit or integration tests
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Generated logic and source generator pipelines MUST explain what is generated, why it is generated, semantic assumptions the generator relies on, and any diagnostics or fallback behavior
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators/Diagnostics/GodotProjectDiagnostics.csGFramework.Godot.SourceGenerators/README.mdGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
📚 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} : 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
Applied to files:
GFramework.Godot.SourceGenerators/README.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:
GFramework.Godot.SourceGenerators/README.mddocs/zh-CN/source-generators/godot-project-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 **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Mirror the source structure in test projects whenever practical
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : When a public API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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:
GFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
🪛 GitHub Check: Build and Test
GFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
[failure] 599-599:
The type or namespace name 'LinePosition' could not be found (are you missing a using directive or an assembly reference?)
[failure] 599-599:
The type or namespace name 'LinePositionSpan' could not be found (are you missing a using directive or an assembly reference?)
[failure] 598-598:
The name 'TextSpan' does not exist in the current context
[failure] 130-130:
'INamedTypeSymbol' does not contain a definition for 'IsAssignableTo' and no accessible extension method 'IsAssignableTo' accepting a first argument of type 'INamedTypeSymbol' could be found (are you missing a using directive or an assembly reference?)
[failure] 109-109:
The name 'SourceText' does not exist in the current context
[failure] 101-101:
The name 'SourceText' does not exist in the current context
[failure] 47-47:
A static anonymous function cannot contain a reference to 'this' or 'base'.
[failure] 36-36:
A static anonymous function cannot contain a reference to 'this' or 'base'.
[failure] 47-47:
Argument 3: cannot convert from 'System.Collections.Immutable.ImmutableArray' to 'System.Collections.Immutable.ImmutableArray<GFramework.Godot.SourceGenerators.GodotProjectMetadataGenerator.ProjectMetadataParseResult>'
[failure] 35-35:
The name 'Path' does not exist in the current context
🪛 LanguageTool
GFramework.Godot.SourceGenerators/README.md
[uncategorized] ~102-~102: 您的意思是“"不"全”?
Context: ...nputActions.MoveUp)) { } ``` - 动作名会转换为可补全的 C# 标识符,例如 move_up -> MoveUp - 当多个动作...
(BU)
🔇 Additional comments (9)
AGENTS.md (2)
22-41: 新增的代理使用规则结构清晰且全面!该部分有效地建立了代理委托的明确准则,包括使用场景、代理类型区分、必需的元数据要求以及主代理的审查责任。这些规则具有可操作性并与检索到的学习内容保持一致。
37-39: 模型名称有效,代码无需修改。
gpt-5.1-codex-mini和gpt-5.4都是 OpenAI 当前提供的有效模型名称,已在官方 API 中可用。GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.cs (1)
18-41: 测试驱动入口设计清晰,便于覆盖 AdditionalFiles 场景。
Run<TGenerator>的编译装配、AdditionalText 注入与运行结果返回路径都很直接,作为生成器测试基建是合理的。docs/.vitepress/config.mts (1)
254-254: 侧边栏入口补充正确。新增“Godot 项目元数据”导航项与本次功能文档路径一致。
docs/zh-CN/api-reference/index.md (1)
455-465: API 参考已补齐AutoLoadAttribute文档映射。这部分与新增生成器能力保持一致,便于用户从 API 索引定位到集成文档。
GFramework.Godot.SourceGenerators/AnalyzerReleases.Unshipped.md (1)
36-41: 新增诊断发布记录与实现严重级别一致。
GF_Godot_Project_001为 Error,002~006为 Warning,和诊断定义保持一致。docs/zh-CN/tutorials/godot-integration.md (1)
17-35: 新增的编译期接入章节实用性很好。把
AutoLoads/InputActions的最小用法直接放进教程,能显著降低首次接入成本。docs/zh-CN/source-generators/godot-project-generator.md (1)
1-169: 文档结构完整,已覆盖接入路径与关键约束。新增页面把 NuGet/直接引用两种接入方式、生成行为、冲突退化策略与诊断场景串联得很清楚。
GFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs (1)
31-47: 此评论不正确 — 方法均已声明为static,调用有效。
ParseProjectFile和Execute都已声明为private static方法,因此在staticlambda 中通过简单名直接调用是完全有效的 C# 代码。静态 lambda 可以不受限制地调用静态方法,无需类型限定。此处不存在编译错误。> Likely an incorrect or invalid review comment.
- 新增 AdditionalTextGeneratorTestDriver 用于源生成器测试 - 添加 AutoLoadAttribute 特性支持 AutoLoad 类型映射 - 扩展项目构建目标,支持自定义 project.godot 路径验证 - 创建完整 Godot 集成教程文档,涵盖节点生命周期、信号系统等功能 - 添加源代码生成器测试项目配置和相关依赖包引用
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.
🧹 Nitpick comments (1)
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs (1)
1-204: 测试覆盖全面,之前缺失的诊断分支已补齐。当前测试套件完整覆盖了所有 6 个诊断 ID(GF_Godot_Project_001 至 006),包括显式/隐式映射冲突、标识符碰撞和重复条目等场景。
可选建议:第一个测试
Run_Should_Generate_AutoLoads_And_InputActions内联了完整的 stub 源码,而后续测试使用了CreateSource辅助方法。如果未来需要修改 Godot stub 定义,可考虑统一使用辅助方法以降低维护成本。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs` around lines 1 - 204, The test in Run_Should_Generate_AutoLoads_And_InputActions in GodotProjectMetadataGeneratorTests inlines a large Godot stub while other tests use CreateSource; refactor this test to call the existing CreateSource helper to produce the Godot/Stubs (move the big namespace/string literal into CreateSource or call CreateSource to return that stub) and replace the inline `source` constant with a call to CreateSource so all tests share the same stub generation path (update any test-specific differences by passing parameters to CreateSource or composing additional source strings as needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs`:
- Around line 1-204: The test in Run_Should_Generate_AutoLoads_And_InputActions
in GodotProjectMetadataGeneratorTests inlines a large Godot stub while other
tests use CreateSource; refactor this test to call the existing CreateSource
helper to produce the Godot/Stubs (move the big namespace/string literal into
CreateSource or call CreateSource to return that stub) and replace the inline
`source` constant with a call to CreateSource so all tests share the same stub
generation path (update any test-specific differences by passing parameters to
CreateSource or composing additional source strings as needed).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 523453f3-719d-40b4-9475-88081730f7f2
📒 Files selected for processing (11)
GFramework.Godot.SourceGenerators.Abstractions/AutoLoadAttribute.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.csGFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csprojGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.csGFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targetsGFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.csGFramework.Godot.SourceGenerators/README.mddocs/zh-CN/source-generators/godot-project-generator.mddocs/zh-CN/tutorials/godot-integration.md
✅ Files skipped from review due to trivial changes (5)
- GFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csproj
- docs/zh-CN/tutorials/godot-integration.md
- GFramework.Godot.SourceGenerators.Abstractions/AutoLoadAttribute.cs
- docs/zh-CN/source-generators/godot-project-generator.md
- GFramework.Godot.SourceGenerators/GodotProjectMetadataGenerator.cs
🚧 Files skipped from review as they are similar to previous changes (2)
- GFramework.Godot.SourceGenerators/GeWuYou.GFramework.Godot.SourceGenerators.targets
- GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriver.cs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality & Security
- GitHub Check: Analyze (C#)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: LoggerGenerator must automatically generate log fields and logging helper methods for classes decorated with [Log] attribute
PriorityGenerator must generate priority comparison implementations for classes decorated with [Priority] attribute
EnumExtensionsGenerator must generate enum extension capabilities for enums decorated with [GenerateEnumExtensions] attribute
ContextAwareGenerator must automatically implement IContextAware boilerplate logic for classes decorated with [ContextAware] attribute
Files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
**/*.{cs,csx}
📄 CodeRabbit inference engine (AGENTS.md)
All public, protected, and internal types and members MUST include XML documentation comments (
///) with<summary>,<param>,<returns>,<exception>, and<remarks>tags where applicableAdd inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds, compatibility constraints, edge cases, and registration order
Core framework components (Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types) MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every required
usingexplicitlyWrite null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern
GFramework.{Module}.{Feature}with PascalCase segmentsFollow standard C# naming: types, methods, properties, events, and constants use PascalCase; interfaces use
Iprefix; parameters and locals use camelCase; private fields use_camelCaseUse 4 spaces for indentation; do not use tabs
Use Allman braces style in C#
Keep
usingdirectives at the top of the file and sort them consistentlySeparate logical blocks with blank lines when it improves readability
Prefer one primary type per file unless the surrounding project already uses a different local pattern
Keep a single source file under roughly 800-1000 lines; if a file grows beyond that range, check whether responsibilities should be split before continuing
Keep line length readable, with around 120 characters as the preferred upper bound
Prefer explicit, readable code over clever shorthand in framework intern...
Files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
**/Abstractions/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Abstractions projects must only contain interface and contract definitions, not runtime implementation logic
Files:
GFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.cs
**/*.{md,markdown}
📄 CodeRabbit inference engine (AGENTS.md)
Update the relevant
README.mdordocs/page when behavior, setup steps, architecture guidance, or user-facing examples changeKeep code samples, package names, and command examples in documentation aligned with the current repository state
Prefer documenting behavior and design intent, not only API surface
For integration-oriented features such as the AI-First config system, documentation MUST cover project directory layout and file conventions, required project or package wiring, minimal working usage example, and migration or compatibility notes
Files:
GFramework.Godot.SourceGenerators/README.md
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Read `@.ai/environment/tools.ai.yaml` before choosing runtimes or CLI tools
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Prefer project-relevant tools listed in `@.ai/environment/tools.ai.yaml` instead of assuming every installed system tool is available
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: When working in WSL against a Windows-backed worktree, prefer Windows Git from WSL (e.g., `git.exe`) instead of the Linux `git` binary
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Use subagents only when the task is complex, context is likely to grow too large, or work can be split into independent parallel subtasks
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: The main agent MUST identify the critical path first and should not delegate the immediate blocking task if the next local step depends on that result
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Keep abstractions projects free of implementation details and engine-specific dependencies
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Preserve existing module boundaries; do not introduce new cross-module dependencies without clear architectural need
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Public API changes must be covered by unit or integration tests
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: When a public API defines multiple contract branches, tests MUST cover the meaningful variants, including null, empty, default, and filtered inputs when those branches change behavior
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Regression fixes should include a test that fails before the fix and passes after it
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Mirror the source structure in test projects whenever practical
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Keep tests focused on observable behavior, not implementation trivia
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: Minimize new package dependencies; add them only when necessary and keep scope narrow
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document under `local-plan/todos/` in the same change
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: If an existing documentation page no longer reflects the current implementation, fixing the code without fixing the documentation is considered incomplete work
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:07:09.826Z
Learning: 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
📚 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:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Public API changes must be covered by unit or integration tests
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.csGFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : When a public API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.csGFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.cs
📚 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 : Mirror the source structure in test projects whenever practical
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Generated logic and source generator pipelines MUST explain what is generated, why it is generated, semantic assumptions the generator relies on, and any diagnostics or fallback behavior
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : When generator behavior changes intentionally, update snapshots together with the implementation
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Keep source generators deterministic and free of hidden environment or network dependencies
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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} : 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
Applied to files:
GFramework.Godot.SourceGenerators/README.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 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:
GFramework.Godot.SourceGenerators/README.md
🪛 LanguageTool
GFramework.Godot.SourceGenerators/README.md
[uncategorized] ~105-~105: 您的意思是“"不"全”?
Context: ...nputActions.MoveUp)) { } ``` - 动作名会转换为可补全的 C# 标识符,例如 move_up -> MoveUp - 当多个动作...
(BU)
🔇 Additional comments (4)
GFramework.Godot.SourceGenerators.Tests/Core/AdditionalTextGeneratorTestDriverTests.cs (1)
1-21: LGTM!测试用例覆盖了
NormalizeLineEndings方法的核心行为,输入字符串同时包含 CRLF、CR 和 LF,能有效验证跨平台换行符的统一处理逻辑。GFramework.Godot.SourceGenerators/README.md (1)
9-106: LGTM!新增的文档完整覆盖了
project.godot集成、AutoLoad 强类型访问和 Input Action 常量生成功能,包含 MSBuild 配置选项、代码示例以及诊断与降级策略说明,满足集成导向文档的要求。静态分析提示"可补全的"为误报,该词在此处表示 IDE 代码补全能力,用法正确。
GFramework.Godot.SourceGenerators.Tests/Abstractions/AutoLoadAttributeTests.cs (1)
1-49: LGTM!测试覆盖了
AutoLoadAttribute构造函数的所有验证分支:合法名称存储、空引用拒绝(ArgumentNullException)以及空字符串/纯空白字符串拒绝(ArgumentException)。使用[TestCase]进行参数化测试和Assert.Multiple进行分组断言的做法符合最佳实践。GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs (1)
502-559: 辅助方法设计合理,有效减少了重复代码。
RunGenerator和CreateSource方法封装了测试的通用逻辑,使各测试用例聚焦于验证特定行为。CreateSource通过includeAutoLoadAttribute参数灵活控制是否包含AutoLoadAttribute定义,符合测试可维护性要求。
- 验证 AutoLoad 和 Input Action 强类型入口生成 - 测试非节点类型上的 AutoLoad 标记诊断 - 验证输入动作标识符冲突处理和后缀追加 - 测试多个显式映射指向相同 AutoLoad 的重复检测 - 验证不同命名空间同名节点类型的冲突处理 - 测试 AutoLoad 标识符冲突的诊断和后缀追加 - 验证项目文件中重复 AutoLoad 条目的处理 - 测试重复输入动作条目的诊断和保留机制
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)
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs (1)
272-464: 建议统一补充诊断Severity断言,锁定诊断契约。Line 275、Line 320、Line 366、Line 394、Line 423、Line 455 等位置目前主要断言了诊断 Id。建议同步断言 Warning/Error,避免未来仅调整 Severity 时测试漏报。
可复用的断言辅助方法示例
+ private static void AssertSingleDiagnostic( + GeneratorDriverRunResult result, + string expectedId, + DiagnosticSeverity expectedSeverity) + { + var diagnostic = result.Results.Single().Diagnostics.Single(); + Assert.That(diagnostic.Id, Is.EqualTo(expectedId)); + Assert.That(diagnostic.Severity, Is.EqualTo(expectedSeverity)); + }- Assert.That(diagnostics.Select(static item => item.Id), Is.EqualTo(new[] { "GF_Godot_Project_004" })); + AssertSingleDiagnostic(result, "GF_Godot_Project_004", DiagnosticSeverity.Warning);Based on learnings, "Keep tests focused on observable behavior, not implementation trivia".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs` around lines 272 - 464, Each impacted test should also assert the diagnostic Severity to lock the diagnostic contract: update the tests Run_Should_Report_Diagnostic_When_Explicit_AutoLoad_Mappings_Are_Duplicated, Run_Should_Report_Diagnostic_When_Implicit_AutoLoad_Mappings_Are_Ambiguous, Run_Should_Report_Diagnostic_And_Append_Suffix_When_AutoLoad_Identifiers_Collide, Run_Should_Report_Diagnostic_When_Project_File_Contains_Duplicate_AutoLoads, Run_Should_Report_Diagnostic_When_Project_File_Contains_Duplicate_Input_Actions (and the earlier input-action test) to assert diagnostics.Single() or diagnostics.Select(...) includes the expected DiagnosticSeverity for the corresponding diagnostic Id (e.g. GF_Godot_Project_002/003/004/005/006); locate uses of the diagnostics variable and Add an assertion on the .Severity property (or create a small helper assertion method used by these tests to reduce duplication) so tests fail if the severity changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs`:
- Around line 15-464: Add regression tests covering the missing contract
branches for no/empty project.godot and empty [autoload]/[input] sections:
create new test(s) in GodotProjectMetadataGeneratorTests that call
AdditionalTextGeneratorTestDriver.Run or RunGenerator with (1) no additional
text (no project.godot), (2) an empty project.godot (""), and (3) a
project.godot that contains only empty [autoload] or [input] sections; assert
that the generator returns no unexpected diagnostics (or the exact expected
diagnostics for those branches) and that generatedSources either contain only
the standard empty/nullable headers or do not produce AutoLoads/InputActions
files as appropriate (mirror assertions style used in
Run_Should_Generate_AutoLoads_And_InputActions and
Run_Should_Report_Diagnostic_When_Project_File_Contains_Duplicate_Input_Actions
to locate CreateSource, RunGenerator, AdditionalTextGeneratorTestDriver.Run, and
AdditionalTextGeneratorTestDriver.ToGeneratedSourceMap).
---
Nitpick comments:
In
`@GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs`:
- Around line 272-464: Each impacted test should also assert the diagnostic
Severity to lock the diagnostic contract: update the tests
Run_Should_Report_Diagnostic_When_Explicit_AutoLoad_Mappings_Are_Duplicated,
Run_Should_Report_Diagnostic_When_Implicit_AutoLoad_Mappings_Are_Ambiguous,
Run_Should_Report_Diagnostic_And_Append_Suffix_When_AutoLoad_Identifiers_Collide,
Run_Should_Report_Diagnostic_When_Project_File_Contains_Duplicate_AutoLoads,
Run_Should_Report_Diagnostic_When_Project_File_Contains_Duplicate_Input_Actions
(and the earlier input-action test) to assert diagnostics.Single() or
diagnostics.Select(...) includes the expected DiagnosticSeverity for the
corresponding diagnostic Id (e.g. GF_Godot_Project_002/003/004/005/006); locate
uses of the diagnostics variable and Add an assertion on the .Severity property
(or create a small helper assertion method used by these tests to reduce
duplication) so tests fail if the severity changes.
🪄 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: d16eec5e-0722-45b9-8518-da4b049d1d3d
📒 Files selected for processing (1)
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality & Security
- GitHub Check: Analyze (C#)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: LoggerGenerator must automatically generate log fields and logging helper methods for classes decorated with [Log] attribute
PriorityGenerator must generate priority comparison implementations for classes decorated with [Priority] attribute
EnumExtensionsGenerator must generate enum extension capabilities for enums decorated with [GenerateEnumExtensions] attribute
ContextAwareGenerator must automatically implement IContextAware boilerplate logic for classes decorated with [ContextAware] attributeInclude XML documentation comments (
///) with<summary>,<param>,<returns>,<exception>, and<remarks>tags for all public, protected, and internal types and members in C# codeAdd inline comments for non-trivial logic, concurrency behavior, performance-sensitive paths, workarounds, and edge cases in C# code
Document the core idea, key decisions, and edge case handling in methods with non-trivial logic
Do not rely on implicit imports; declare every required
usingexplicitly in C# files withImplicitUsingsdisabledWrite null-safe code that respects nullable annotations instead of suppressing warnings by default in C# files with
NullableenabledUse the namespace pattern
GFramework.{Module}.{Feature}with PascalCase segments in C# codeFollow C# naming conventions: PascalCase for types, methods, properties, events, and constants;
Iprefix for interfaces; camelCase for parameters and locals;_camelCasefor private fieldsUse 4 spaces for indentation and Allman braces in C# code
Keep
usingdirectives at the top of the file and sort them consistently in C# codeSeparate logical blocks with blank lines when it improves readability in C# code
Prefer one primary type per file unless the project already uses a different local pattern
Keep a single source file under roughly 800-1000 lines; check if responsibilities should be split before continuing if a file grows beyond that range
Keep line length readable with around 120 character...
Files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
**/*[Gg]enerator*.cs
📄 CodeRabbit inference engine (AGENTS.md)
Explain generated logic, generator pipelines, semantic assumptions, diagnostics, and fallback behavior in source generator code
Keep source generators deterministic and free of hidden environment or network dependencies
Files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Before choosing runtimes or CLI tools, read `@.ai/environment/tools.ai.yaml`
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Document responsibilities, lifecycle, component interactions, abstraction rationale, and usage alternatives for core framework components (Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types)
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Keep abstractions projects free of implementation details and engine-specific dependencies
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Preserve existing module boundaries and do not introduce new cross-module dependencies without clear architectural need
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: When a public API defines multiple contract branches, tests MUST cover the meaningful variants, including null, empty, default, and filtered inputs when those branches change behavior
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Include a test that fails before the fix and passes after it for regression fixes
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Mirror the source structure in test projects whenever practical
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Reuse existing architecture test infrastructure (`ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`) when relevant
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Keep tests focused on observable behavior, not implementation trivia
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Preserve snapshot-based verification patterns already used in the repository for source generator testing
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: When generator behavior changes intentionally, update snapshots together with the implementation
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Minimize new package dependencies and add them only when necessary with narrow scope
Learnt from: CR
URL:
File: AGENTS.md:undefined-undefined
Timestamp: 2026-04-14T01:24:42.648Z
Learning: Reflect completed work, newly discovered issues, validation results, and the next recommended recovery point in tracking documents
📚 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:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Public API changes must be covered by unit or integration tests
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Mirror the source structure in test projects whenever practical
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Generated logic and source generator pipelines MUST explain what is generated, why it is generated, semantic assumptions the generator relies on, and any diagnostics or fallback behavior
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : When a public API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : When generator behavior changes intentionally, update snapshots together with the implementation
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 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 : Keep source generators deterministic and free of hidden environment or network dependencies
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs
🔇 Additional comments (1)
GFramework.Godot.SourceGenerators.Tests/Project/GodotProjectMetadataGeneratorTests.cs (1)
284-464: 回归分支覆盖明显完善,方向正确。
GF_Godot_Project_002/003/005/006以及隐式映射歧义退化分支都已覆盖,且断言了关键生成结果,能有效降低后续重构回归风险。
- 验证基于 project.godot 的 AutoLoad 和 Input Action 强类型入口生成 - 测试 AutoLoad 类型非节点继承时的诊断报告功能 - 验证 Input Action 标识符冲突时的后缀追加和警告机制 - 测试多个显式映射指向同一 AutoLoad 时的重复检测 - 验证不同命名空间同名节点类型的隐式映射冲突处理 - 测试 AutoLoad 和 Input Action 重复条目的诊断和保留逻辑 - 验证缺失或空 project.godot 文件时的无生成行为
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.
Summary by CodeRabbit
新增功能
诊断
文档
测试