mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +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
|
@ -2,7 +2,7 @@ use ruff_formatter::{format_args, write, FormatRuleWithOptions};
|
|||
use ruff_python_ast::node::{AnyNodeRef, AstNode};
|
||||
use ruff_python_ast::{Expr, ExprSubscript};
|
||||
|
||||
use crate::comments::trailing_comments;
|
||||
use crate::comments::{trailing_comments, SourceComment};
|
||||
use crate::context::PyFormatContext;
|
||||
use crate::context::{NodeLevel, WithNodeLevel};
|
||||
use crate::expression::expr_tuple::TupleParentheses;
|
||||
|
@ -81,7 +81,7 @@ impl FormatNodeRule<ExprSubscript> for FormatExprSubscript {
|
|||
|
||||
fn fmt_dangling_comments(
|
||||
&self,
|
||||
_node: &ExprSubscript,
|
||||
_dangling_comments: &[SourceComment],
|
||||
_f: &mut PyFormatter,
|
||||
) -> FormatResult<()> {
|
||||
// Handled inside of `fmt_fields`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue