-
Notifications
You must be signed in to change notification settings - Fork 904
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
refactor rewrite_literal & combine_strs_with_missing_comments #6250
Conversation
let shape = if contains_comment { | ||
shape.block_left(context.config.tab_spaces())? | ||
shape | ||
.block_left(context.config.tab_spaces()) | ||
.max_width_error(shape.width, between_span.with_hi(ex.span().hi()))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... = // comment
Expr
Since between_span
corresponds to the span of // comment
but we are calculating the shape for the expr
, I think the span for max_width_error
should start from between_span.lo()
and end with expr.span.hi()
src/chains.rs
Outdated
@@ -267,8 +267,15 @@ impl ChainItemKind { | |||
} | |||
|
|||
impl Rewrite for ChainItem { | |||
// TODO impl rewrite_result after rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering what this comment is referencing. Can this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, since this pr also implements rewrite_result for ChainItem, I removed the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for another rewrite_result
PR. Running the Diff-Check Job now
Edit: Job passed ✅
Tracked by #6206
Description
combine_strs_with_missing_comments
and its call sites