mirror of https://github.com/astral-sh/ruff
save f.context.comments() to comments
This commit is contained in:
parent
0f1ea90c5c
commit
5fee7534f7
|
|
@ -405,11 +405,9 @@ impl Format<PyFormatContext<'_>> for FormatBody<'_> {
|
|||
// )
|
||||
// )
|
||||
// ```
|
||||
if is_expression_parenthesized(
|
||||
(*body).into(),
|
||||
f.context().comments().ranges(),
|
||||
f.context().source(),
|
||||
) && f.context().comments().has_leading(*body)
|
||||
let comments = f.context().comments();
|
||||
if is_expression_parenthesized((*body).into(), comments.ranges(), f.context().source())
|
||||
&& comments.has_leading(*body)
|
||||
{
|
||||
if leading_body_comments.is_empty() {
|
||||
write!(
|
||||
|
|
|
|||
Loading…
Reference in New Issue