diff options
author | Aleksey Kladov <[email protected]> | 2018-08-28 17:23:55 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-28 17:23:55 +0100 |
commit | 537ea620bb2a73a5e79872f414af23cf4bf03179 (patch) | |
tree | 875b5c789e027615be5466a74bf7053a6798da0d /crates/libeditor/src/lib.rs | |
parent | d34588bf83898870d7f9b4b49ac2a5f71c77dabb (diff) |
complete items from module scope
Diffstat (limited to 'crates/libeditor/src/lib.rs')
-rw-r--r-- | crates/libeditor/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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; | |||
18 | 18 | ||
19 | use libsyntax2::{ | 19 | use libsyntax2::{ |
20 | File, TextUnit, TextRange, SyntaxNodeRef, | 20 | File, TextUnit, TextRange, SyntaxNodeRef, |
21 | ast::{AstNode, NameOwner}, | 21 | ast::{self, AstNode, NameOwner}, |
22 | algo::{walk, find_leaf_at_offset, ancestors}, | 22 | algo::{walk, find_leaf_at_offset, ancestors}, |
23 | SyntaxKind::{self, *}, | 23 | SyntaxKind::{self, *}, |
24 | }; | 24 | }; |
@@ -126,8 +126,8 @@ pub fn syntax_tree(file: &File) -> String { | |||
126 | } | 126 | } |
127 | 127 | ||
128 | pub fn runnables(file: &File) -> Vec<Runnable> { | 128 | pub fn runnables(file: &File) -> Vec<Runnable> { |
129 | file.ast() | 129 | walk::preorder(file.syntax()) |
130 | .functions() | 130 | .filter_map(ast::FnDef::cast) |
131 | .filter_map(|f| { | 131 | .filter_map(|f| { |
132 | let name = f.name()?.text(); | 132 | let name = f.name()?.text(); |
133 | let kind = if name == "main" { | 133 | let kind = if name == "main" { |