Use single lookup for leading, dangling, and trailing comments (#6589)

This commit is contained in:
Micha Reiser 2023-08-15 17:39:45 +02:00 committed by GitHub
parent 81b1176f99
commit 29c0b9f91c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 319 additions and 387 deletions

View file

@ -1,5 +1,5 @@
use crate::builders::{parenthesize_if_expands, PyFormatterExtensions};
use crate::comments::dangling_node_comments;
use crate::comments::{dangling_node_comments, SourceComment};
use crate::expression::maybe_parenthesize_expression;
use crate::expression::parentheses::Parenthesize;
use crate::{FormatNodeRule, PyFormatter};
@ -53,7 +53,11 @@ impl FormatNodeRule<StmtDelete> for FormatStmtDelete {
}
}
fn fmt_dangling_comments(&self, _node: &StmtDelete, _f: &mut PyFormatter) -> FormatResult<()> {
fn fmt_dangling_comments(
&self,
_dangling_comments: &[SourceComment],
_f: &mut PyFormatter,
) -> FormatResult<()> {
// Handled in `fmt_fields`
Ok(())
}