Skip to content

Fix resolved call sites in nested BSN macros - #26314

Open
nelson137 wants to merge 9 commits into
bevyengine:mainfrom
nelson137:fix/bsn-macro-call-site
Open

nelson137 wants to merge 9 commits into
bevyengine:mainfrom
nelson137:fix/bsn-macro-call-site

Conversation

@nelson137

Copy link
Copy Markdown

Objective

Fix #25407. Supersedes first attempt #26190.

Solution

Implement Alice's fix.

Testing

Bring over the tests from the first attempt along with a couple new regression tests that cover the heart of the bug.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Scenes Composing and serializing ECS objects S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 25, 2026
@alice-i-cecile alice-i-cecile added this to the 0.20.1 milestone Oct 25, 2026
@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 26, 2026
@nelson137

Copy link
Copy Markdown
Author

I want to call attention to the last commit on this branch, (which I kept separate from the other changes so it can be easily reverted if anyone disagrees with it). Applying the fix meant parenthesized_tokens() and bracketed_tokens() had no callers so I deleted them. That left just braced_tokens(), which I then deleted in the last commit. Reading through the history it looks like group_tokens() is newer, and given that it, like the others, maintains autocomplete support in the macro body, as well as being the fix for call sites, it felt like the better util to be using.

@nelson137
nelson137 force-pushed the fix/bsn-macro-call-site branch from 2dfcc42 to 2f87ca1 Compare October 26, 2026 00:12

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for taking a crack at this :) CI has caught the problems, but the reason it's failing is that the fix is applied too widely. You only need group_tokens on the TypeFunction | Function arm. Your other uses are resulting in double braces :)

Comment thread crates/bevy_scene/src/resolved_scene.rs Outdated
@nelson137

Copy link
Copy Markdown
Author

Hmm CI is still failing on extra brackets. I think I need to further narrow this fix in the input.peek(Brace) branch to when maybe_macro.is_some().

@mockersf mockersf modified the milestones: 0.20.1, 0.20.2 Oct 28, 2026
@nelson137
nelson137 force-pushed the fix/bsn-macro-call-site branch from d37dd68 to 68ab17e Compare October 29, 2026 05:39
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Oct 29, 2026

This branch has not been deployed

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

Labels

A-Scenes Composing and serializing ECS objects C-Bug An unexpected or incorrect behavior S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken entity hierarchy when projecting sub-scene through scene component with names

3 participants