Repository navigation
Fix custom sidebar function return and file-scope bindings - #9501
Closed
austinywang wants to merge 2 commits into
Closed
austinywang wants to merge 2 commits into
austinywang wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe interpreter now binds top-level variables before evaluation and propagates explicit returns through view helpers, loops, conditionals, and switches. Tests cover early view returns and file-scope bindings used inside functions. ChangesInterpreter semantics
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SwiftViewInterpreter
participant evalItems
participant ViewBlockResult
SwiftViewInterpreter->>evalItems: evaluate user-defined view helper
evalItems->>ViewBlockResult: evaluate statements
ViewBlockResult-->>evalItems: returned node or completed nodes
evalItems-->>SwiftViewInterpreter: render helper result
🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
returnthrough view-positionif,switch, andforevaluation so a view function exits instead of appending fallthrough nodesFixes #7945
Testing
ca520f1703on fleet builderaws-m4pro-6:swift test --filter returnExitsViewFunctionBeforeFallthroughfailed because the rendered child was a nested node containing both return pathsswift test --filter topLevelLetIsVisibleInsideFunctionfailed witha-b-cinstead ofX:a-b-c7b168f0fd7on the same fleet builder:swift test --filter ...commands passedswift testpassed all 68 tests inCmuxSwiftRenderreload-cloud.sh --tag sym7945 --builder fleet --pool-tag tag:macbuilder --slot cmuxs-mac-mini-2.1 --launchcompleted withBUILD_OK/tmp/cmux-debug-sym7945.sock:sidebar validate,sidebar select, andsidebar reloadsucceeded for both repro sidebarsdebug.window.screenshotshowed onlyEARLYafter the early return, with noFALLTHROUGHX:a-b-cpkill -f "DerivedData/cmux-sym7945"and removed its stale socketLocalization audit: no user-facing strings changed.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the custom sidebar interpreter in
CmuxSwiftRenderso explicit returns exit view functions and file-scope constants are visible inside user functions.let/vardeclarations into the root eval environment so helper functions can read file-scope constants.returnthrough view-positionif,switch, andforso a view function returns early instead of appending fallthrough nodes.Written for commit 7b168f0. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests