Skip to content

fix oboe wrapping struct field comments #6242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vertical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ fn rewrite_aligned_items_inner<T: AlignedItem>(
force_trailing_separator: bool,
) -> Option<String> {
// 1 = ","
let item_shape = Shape::indented(offset, context.config).sub_width(1)?;
let item_shape = Shape::indented(offset, context.config).sub_width(0)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the correct approach. First because CI is failing, but also because we .sub_width(1) to make sure that the field + trailing comma doesn't exceed the max_width. I think you'll need to look a little deeper into this to understand what shape gets used to rewrite the comments.

Copy link
Author

Choose a reason for hiding this comment

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

@ytmimi Thanks for the review. Will try to look deeper into this issue!

Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to reach out here or on Zulip if you have any questions

Copy link
Author

Choose a reason for hiding this comment

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

Thank you!

let (mut field_prefix_max_width, field_prefix_min_width) =
struct_field_prefix_max_min_width(context, fields, item_shape);
let max_diff = field_prefix_max_width.saturating_sub(field_prefix_min_width);
Expand Down
Loading