Skip to content

feat: suggest candidate compiled lines when an enable line drifts from the edited file - #2279

Merged
hatayama merged 2 commits into
v3-betafrom
feat/pause-point-drift-candidate-lines
Aug 20, 2026
Merged

hatayama merged 2 commits into
v3-betafrom
feat/pause-point-drift-candidate-lines

Conversation

@hatayama

@hatayama hatayama commented Aug 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • When --line from an edited file lands on a different statement in the last compiled source (hot-reload line drift), the enable warning now lists up to 3 candidate compiled line numbers whose text matches the edited statement.

User Impact

  • Before: the drift warning showed compiled vs edited text at the resolved line, but not where that edited statement lives in the last compiled source, so you had to recompute --line by hand.
  • After: a non-empty drift warning appends candidate compiled line numbers (1 match / several matches / first 3 plus a truncation note). No extra file reads: candidate search reuses the compiled snapshot already loaded for ResolvedLineText.

Changes

  • Search last-compiled-source lines for an Ordinal trimmed match of the edited line text, only when the existing drift warning is non-empty.
  • Append a candidate sentence that names last-compiled-source line numbers; 0 matches add nothing.
  • Enable path loads the verified compiled snapshot once and reuses it for resolved line text and candidate search.

Verification

  • dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)" → ErrorCount 0
  • dist/darwin-arm64/uloop run-tests --test-mode EditMode --filter-type regex --filter-value "PausePointCompiledLineMapWarningTests" → 29 passed, 0 failed
  • CODE_COMPLEXITY_FAIL_ON_EXCEEDED=true scripts/check-code-complexity.sh → no CA1502 findings above 15

Review in cubic

…m the edited file

Line-drift warnings already showed compiled vs edited text at the resolved line, but not where that edited statement lives in the last compiled source, so testers had to recompute line numbers by hand.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 27ecc3fa-bee4-4fcd-987a-87d25baf1aaf

📥 Commits

Reviewing files that changed from the base of the PR and between 700cbff and df3325b.

📒 Files selected for processing (3)
  • Assets/Tests/Editor/PausePointCompiledLineMapWarningTests.cs
  • Packages/src/Editor/FirstPartyTools/PausePoint/PausePointEnableWarnings.cs
  • Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change enriches compiled-line drift warnings with matching compiled source line numbers. It centralizes source splitting, loads verified snapshot source once, limits matches to three, and adds coverage for matching and non-matching cases.

Changes

Compiled-line drift warning enrichment

Layer / File(s) Summary
Warning matching and source-line contracts
Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs, Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointSourceLineReader.cs, Packages/src/Editor/FirstPartyTools/PausePoint/PausePointEnableWarnings.cs
Candidate warnings match trimmed edited text, skip null lines, report up to three 1-based compiled lines, and indicate truncation. Source splitting now normalizes line endings through a shared helper.
Snapshot source integration
Packages/src/Editor/FirstPartyTools/PausePoint/PausePointUseCase.cs
Hot-reload drift handling loads verified snapshot source once, splits it into lines, and passes those lines to warning generation.
Candidate warning test coverage
Assets/Tests/Editor/PausePointCompiledLineMapWarningTests.cs
Tests cover one match, multiple matches, truncation, no matches, empty warnings, and edited-versus-compiled return values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to df332

The change is localized to improving drift-warning guidance, and no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant PausePointUseCase
  participant VerifiedSnapshotProvider
  participant SourcePausePointSourceLineReader
  participant PausePointEnableWarnings
  PausePointUseCase->>VerifiedSnapshotProvider: Load verified snapshot source
  VerifiedSnapshotProvider-->>PausePointUseCase: Return compiled source
  PausePointUseCase->>SourcePausePointSourceLineReader: Split source into lines
  SourcePausePointSourceLineReader-->>PausePointUseCase: Return compiled lines
  PausePointUseCase->>PausePointEnableWarnings: Build enriched drift warning
  PausePointEnableWarnings-->>PausePointUseCase: Return warning with candidate lines
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding candidate compiled lines to line-drift warnings.
Description check ✅ Passed The description directly explains candidate-line warnings, snapshot reuse, user impact, changes, and verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pause-point-drift-candidate-lines

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.

…suffix

The new candidate tests assembled expected text from the production format constants, so clearing {0} still passed. The truncation suffix also hard-coded 3 beside CompiledLineDriftCandidateMatchLimit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama
hatayama merged commit 0542971 into v3-beta Aug 20, 2026
14 checks passed
@hatayama
hatayama deleted the feat/pause-point-drift-candidate-lines branch August 20, 2026 02:55
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