mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
Use single lookup for leading, dangling, and trailing comments (#6589)
This commit is contained in:
parent
81b1176f99
commit
29c0b9f91c
39 changed files with 319 additions and 387 deletions
|
@ -1,3 +1,4 @@
|
|||
use crate::comments::SourceComment;
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
use crate::prelude::*;
|
||||
use crate::FormatNodeRule;
|
||||
|
@ -23,7 +24,11 @@ impl FormatNodeRule<ExprName> for FormatExprName {
|
|||
write!(f, [source_text_slice(*range, ContainsNewlines::No)])
|
||||
}
|
||||
|
||||
fn fmt_dangling_comments(&self, _node: &ExprName, _f: &mut PyFormatter) -> FormatResult<()> {
|
||||
fn fmt_dangling_comments(
|
||||
&self,
|
||||
_dangling_comments: &[SourceComment],
|
||||
_f: &mut PyFormatter,
|
||||
) -> FormatResult<()> {
|
||||
// Node cannot have dangling comments
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue