From d323c81d5cc6a198239285abcede2166181d8f39 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 2 Oct 2018 18:02:57 +0300 Subject: make ancestors and descendants inherent --- crates/ra_editor/src/typing.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_editor/src/typing.rs') diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs index 0f4e7e0d0..512076941 100644 --- a/crates/ra_editor/src/typing.rs +++ b/crates/ra_editor/src/typing.rs @@ -4,7 +4,6 @@ use ra_syntax::{ TextUnit, TextRange, SyntaxNodeRef, File, AstNode, SyntaxKind, ast, algo::{ - walk::preorder, find_covering_node, }, text_utils::{intersect, contains_offset_nonstrict}, @@ -33,7 +32,7 @@ pub fn join_lines(file: &File, range: TextRange) -> LocalEdit { }; let node = find_covering_node(file.syntax(), range); let mut edit = EditBuilder::new(); - for node in preorder(node) { + for node in node.descendants() { let text = match node.leaf_text() { Some(text) => text, None => continue, -- cgit v1.2.3