mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:56 +00:00
Rename visit_preorder
to visit_source_order
(#17046)
## Summary We renamed the `PreorderVisitor` to `SourceOrderVisitor` a long time ago but it seems that we missed to rename the `visit_preorder` functions to `visit_source_order`. This PR renames `visit_preorder` to `visit_source_order` ## Test Plan `cargo test`
This commit is contained in:
parent
6b02c39321
commit
050f332771
5 changed files with 8 additions and 8 deletions
|
@ -422,7 +422,7 @@ impl<'a> Comments<'a> {
|
|||
dangling.mark_formatted();
|
||||
}
|
||||
|
||||
node.visit_preorder(&mut MarkVerbatimCommentsAsFormattedVisitor(self));
|
||||
node.visit_source_order(&mut MarkVerbatimCommentsAsFormattedVisitor(self));
|
||||
}
|
||||
|
||||
/// Returns an object that implements [Debug] for nicely printing the [`Comments`].
|
||||
|
@ -460,7 +460,7 @@ impl<'a> Comments<'a> {
|
|||
comments: self,
|
||||
has_comment: false,
|
||||
};
|
||||
node.visit_preorder(&mut visitor);
|
||||
node.visit_source_order(&mut visitor);
|
||||
|
||||
visitor.has_comment
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ impl<'a, 'builder> CommentsVisitor<'a, 'builder> {
|
|||
|
||||
pub(super) fn visit(mut self, root: AnyNodeRef<'a>) {
|
||||
if self.enter_node(root).is_traverse() {
|
||||
root.visit_preorder(&mut self);
|
||||
root.visit_source_order(&mut self);
|
||||
}
|
||||
|
||||
self.leave_node(root);
|
||||
|
|
|
@ -154,7 +154,7 @@ fn find_enclosing_node<'ast>(
|
|||
let mut visitor = FindEnclosingNode::new(range, context);
|
||||
|
||||
if visitor.enter_node(root).is_traverse() {
|
||||
root.visit_preorder(&mut visitor);
|
||||
root.visit_source_order(&mut visitor);
|
||||
}
|
||||
visitor.leave_node(root);
|
||||
|
||||
|
@ -314,7 +314,7 @@ fn narrow_range(
|
|||
};
|
||||
|
||||
if visitor.enter_node(enclosing_node).is_traverse() {
|
||||
enclosing_node.visit_preorder(&mut visitor);
|
||||
enclosing_node.visit_source_order(&mut visitor);
|
||||
}
|
||||
|
||||
visitor.leave_node(enclosing_node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue