Skip to content

fix: Hot reload now says to run uloop compile when an added member uses a name generated at compile time - #3193

Merged
hatayama merged 2 commits into
feature/hot-reload-large-project-feedbackfrom
fix/hot-reload-added-member-unbound-generated-hint
Oct 6, 2026
Merged

hatayama merged 2 commits into
feature/hot-reload-large-project-feedbackfrom
fix/hot-reload-added-member-unbound-generated-hint

Conversation

@hatayama

@hatayama hatayama commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • When an added member's body uses a name that exists only after a compile, for example a member a source generator emits, hot reload still skips the member. Its reason now says that hot reload cannot see such a name and that uloop compile is the step to take.

User Impact

  • Before: the reason offered two steps: pass the declaring file with --files if the name is declared in a new file, and run uloop compile "only if it still does not bind". A generated name has no file to pass, so the first step could not help, and the step that does help read as a last resort.
  • After: the reason names the generated case and points it to uloop compile. The new-file hint and the compile fallback stay.

Changes

The AddedMethodBodyUnbound reason ({0} is the binding error). Only the text after automatically) changes, and it still takes one argument.

Old:

The added member's body could not be fully bound in the hot-reload compilation ({0}); hot reload cannot verify a member it cannot bind, so it is skipped. If the name is declared in a new file, pass that file to --files too (new files are not selected automatically); run 'uloop compile' only if it still does not bind.

New:

The added member's body could not be fully bound in the hot-reload compilation ({0}); hot reload cannot verify a member it cannot bind, so it is skipped. If the name is declared in a new file, pass that file to --files too (new files are not selected automatically). If the name is generated at compile time, for example by a source generator, hot reload cannot see it: run 'uloop compile'. Also run 'uloop compile' if it still does not bind.

Unchanged on purpose:

  • The two other reasons that open with the same words, AddedMethodBodyBindsCompiledSignature and AddedMethodCallsIntroducedMemberBoundToCompiledType. They report a type this reload builds from source while compiled code still names the compiled copy, not a name the reload cannot see, and the Editor appends a next step for the run to them.
  • That appended next step, Pass <files> to this reload as well so both bind to the same type; run 'uloop compile' only if it still does not bind., ends with the same words as the old text but is a separate sentence, used only for those two reasons. Rows with the reason changed here get no next step appended (Resolve_RowsOutsideTheCarriedInFamily_AreReturnedUnchanged pins this), so the new sentence is not followed by another compile hint.
  • Tests that match only the opening words: the Does.StartWith in HotReloadOrchestratorTests, the "could not be fully bound" constant in HotReloadIntroducedTypeRetainedInternalReferrerE2ETests, and the cases for the two other reasons in HotReloadWorkerReasonTextTests.

Verification

  • Red: the expected full text in HotReloadWorkerReasonTextTests was changed first. Against the old template, Render_AddedMethodBodyUnbound failed with Expected string length 473 but was 349. Strings differ at index 296. (right after automatically)); the other 143 tests in the class passed.
  • Mutation: after the change, reverting only the template to the old text makes the same test fail the same way (1 of 144).
  • uloop compile: 0 errors, 0 warnings.
  • uloop run-tests --filter-type regex --filter-value 'HotReloadWorkerReasonTextTests|HotReloadOrchestratorTests|HotReloadSkippedNextStepResolverTests': 345 of 345 passed (144 + 184 + 17).
  • scripts/check-code-complexity.sh (C# CA1502 and Go cyclop, max 15) and scripts/check-file-length.sh (max 500 SLOC): no findings.
  • Not covered: no test runs a real source generator. The text is chosen by the reason code alone, so every added member whose body does not bind gets the same sentence.

This pull request targets the integration branch, so CI runs only the Complexity Report, File Length Report, and Dead Code Gate jobs.

Review in cubic

…compile

A name that is generated at compile time, for example by a source
generator, exists only in the compiled assembly, so the hot-reload
compilation can never bind it. The current reason only tells the user to
pass a new file and to compile as a last resort, which leaves them
retrying --files for a name no file declares.
The hot-reload compilation sees only source files, so a name generated
at compile time, for example by a source generator, never binds there
and passing more files cannot help. The reason now says so and names
'uloop compile' as the step for that case, while keeping the new-file
hint and the compile fallback.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: hatayama/unity-cli-loop/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f8e4ade-7e9f-44bf-8eeb-bf32d48ddfa0
📥 Commits

Reviewing files that changed from the base of the PR and between f2b48b5 and 9b837ee.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/HotReload/HotReloadWorkerReasonTextTests.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/Shared/HotReloadWorkerReasonText.AddedMemberTemplates.cs
 _______________________________________
< Clippy called, he wants his job back. >
 ---------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@hatayama
hatayama merged commit 7c0e77d into feature/hot-reload-large-project-feedback Oct 6, 2026
4 of 5 checks passed
@hatayama
hatayama deleted the fix/hot-reload-added-member-unbound-generated-hint branch October 6, 2026 15:03
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