ruff/crates/ruff_python_formatter/src/comments
Dhruv Manilawala 549cc1e437
Build CommentRanges outside the parser (#11792)
## Summary

This PR updates the parser to remove building the `CommentRanges` and
instead it'll be built by the linter and the formatter when it's
required.

For the linter, it'll be built and owned by the `Indexer` while for the
formatter it'll be built from the `Tokens` struct and passed as an
argument.

## Test Plan

`cargo insta test`
2024-06-09 09:55:17 +00:00
..
snapshots Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
debug.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
format.rs Fix incorect placement of trailing stub function comments (#11632) 2024-05-31 12:06:17 +00:00
map.rs Upgrade to Rust 1.78 (#11260) 2024-05-03 12:46:21 +00:00
mod.rs Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
node_key.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
placement.rs Fix subscript comment placement with parenthesized value (#10496) 2024-03-20 20:30:22 +00:00
visitor.rs Rename PreorderVisitor to SourceOrderVisitor (#11798) 2024-06-07 17:01:58 +00:00