ruff
1d5c4b0a - Show header for formatter comment decoration info (#7228)

Commit
2 years ago
Show header for formatter comment decoration info (#7228) Show header for formatter comment decoration info **Summary** Show a header in the formatter comment decoration debug output that shows which node is preceding/following/enclosing (https://github.com/astral-sh/ruff/pull/6813#issuecomment-1708119550). I kept this intentionally condensed to make it easy to use this is a small sidebar without vertical scrolling. ```console $ cargo run --bin ruff_python_formatter -- --emit stdout --print-comments scratch.py # Comment decoration: Range, Preceding, Following, Enclosing, Comment 17..20, Some((ParameterWithDefault, 6..10)), None, (Parameters, 5..22), "# a" 44..47, Some((StmtExpr, 28..39)), Some((StmtExpr, 52..60)), (StmtFunctionDef, 0..60), "# b" 77..80, None, None, (ExprList, 71..82), "# c" { Node { kind: ParameterWithDefault, range: 6..10, source: `x=[]`, }: { ... ``` **Test Plan** It's debug output.
Author
Parents
Loading