fix(AstNode::bundle_comments): don't bundle at A, // comment \n B #588

Merged
wetneb merged 5 commits from ada4a/mergiraf:bundle-comments-fix1 into main 2025-09-14 19:58:26 +02:00
Owner

Fixes #586

Fixes #586
so that we see which test that invoked it was the one that failed
switch from `fn`s to `mod`s, since they have one fewer children
This commit doesn't change any logic -- it's only separated from the
next one to hopefully make the latter's diff easier to understand.
fix
All checks were successful
/ test (pull_request) Successful in 35s
75b715d451
ada4a force-pushed bundle-comments-fix1 from 75b715d451 to 9d9b17afdd 2025-09-12 01:19:20 +02:00 Compare
wetneb approved these changes 2025-09-14 10:41:51 +02:00
Dismissed
@ -870,0 +1090,4 @@
let rs = ctx.parse("a.rs", source);
assert_eq!(rs.ascii_tree(Some(5), false), BUNDLED_INTO_ABOVE);
}
Owner

The comment says don't bundle but the test asserts that it does - or do I misunderstand the comment? There are a couple of similar cases below.

The comment says don't bundle but the test asserts that it does - or do I misunderstand the comment? There are a couple of similar cases below.
Author
Owner

No, you're right -- the comments got out of sync when copy-pasting.. To help that a little, I removed all the comments from the tests where expected is a constant, because the name of the constant already describes what the expectation is.

No, you're right -- the comments got out of sync when copy-pasting.. To help that a little, I removed all the comments from the tests where `expected` is a constant, because the name of the constant already describes what the expectation is.
ada4a marked this conversation as resolved
@ -870,0 +1158,4 @@
let rs = ctx.parse("a.rs", source);
assert_eq!(rs.ascii_tree(Some(4), false), BUNDLED_INTO_ABOVE_SAME_LINE);
}
Owner

I'm curious why you went for a macro and not just a loop. Is the error reporting better when some assertion fails?

I'm curious why you went for a macro and not just a loop. Is the error reporting better when some assertion fails?
Author
Owner

I expected it to be, but that turns out not to be the case.. Replaced with a loop

I expected it to be, but that turns out not to be the case.. Replaced with a loop
ada4a marked this conversation as resolved
ada4a force-pushed bundle-comments-fix1 from 9d9b17afdd to 5d987e2208 2025-09-14 13:46:37 +02:00 Compare
ada4a force-pushed bundle-comments-fix1 from 5d987e2208 to 49bf47c2d3 2025-09-14 13:52:48 +02:00 Compare
wetneb approved these changes 2025-09-14 19:58:13 +02:00
wetneb merged commit c511f2af78 into main 2025-09-14 19:58:26 +02:00
ada4a deleted branch bundle-comments-fix1 2025-09-14 19:59:08 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: mergiraf/mergiraf#588
No description provided.