From 537ea620bb2a73a5e79872f414af23cf4bf03179 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 19:23:55 +0300 Subject: complete items from module scope --- crates/libeditor/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/libeditor/src/lib.rs') diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs index b2e2c4782..06dac9d6d 100644 --- a/crates/libeditor/src/lib.rs +++ b/crates/libeditor/src/lib.rs @@ -18,7 +18,7 @@ mod test_utils; use libsyntax2::{ File, TextUnit, TextRange, SyntaxNodeRef, - ast::{AstNode, NameOwner}, + ast::{self, AstNode, NameOwner}, algo::{walk, find_leaf_at_offset, ancestors}, SyntaxKind::{self, *}, }; @@ -126,8 +126,8 @@ pub fn syntax_tree(file: &File) -> String { } pub fn runnables(file: &File) -> Vec { - file.ast() - .functions() + walk::preorder(file.syntax()) + .filter_map(ast::FnDef::cast) .filter_map(|f| { let name = f.name()?.text(); let kind = if name == "main" { -- cgit v1.2.3