diff options
Diffstat (limited to 'crates/libeditor/src/lib.rs')
-rw-r--r-- | crates/libeditor/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs index 293fafae7..4ea344b17 100644 --- a/crates/libeditor/src/lib.rs +++ b/crates/libeditor/src/lib.rs | |||
@@ -2,16 +2,21 @@ extern crate libsyntax2; | |||
2 | extern crate superslice; | 2 | extern crate superslice; |
3 | 3 | ||
4 | mod extend_selection; | 4 | mod extend_selection; |
5 | mod symbols; | ||
5 | mod line_index; | 6 | mod line_index; |
6 | 7 | ||
7 | use libsyntax2::{ | 8 | use libsyntax2::{ |
8 | ast, | 9 | ast::{self, NameOwner}, |
9 | SyntaxNodeRef, AstNode, | 10 | SyntaxNodeRef, AstNode, |
10 | algo::walk, | 11 | algo::walk, |
11 | SyntaxKind::*, | 12 | SyntaxKind::*, |
12 | }; | 13 | }; |
13 | pub use libsyntax2::{File, TextRange, TextUnit}; | 14 | pub use libsyntax2::{File, TextRange, TextUnit}; |
14 | pub use self::line_index::{LineIndex, LineCol}; | 15 | pub use self::{ |
16 | line_index::{LineIndex, LineCol}, | ||
17 | extend_selection::extend_selection, | ||
18 | symbols::{FileSymbol, file_symbols} | ||
19 | }; | ||
15 | 20 | ||
16 | #[derive(Debug)] | 21 | #[derive(Debug)] |
17 | pub struct HighlightedRange { | 22 | pub struct HighlightedRange { |
@@ -108,11 +113,6 @@ pub fn symbols(file: &ast::File) -> Vec<Symbol> { | |||
108 | res // NLL :-( | 113 | res // NLL :-( |
109 | } | 114 | } |
110 | 115 | ||
111 | pub fn extend_selection(file: &ast::File, range: TextRange) -> Option<TextRange> { | ||
112 | let syntax = file.syntax(); | ||
113 | extend_selection::extend_selection(syntax.as_ref(), range) | ||
114 | } | ||
115 | |||
116 | pub fn runnables(file: &ast::File) -> Vec<Runnable> { | 116 | pub fn runnables(file: &ast::File) -> Vec<Runnable> { |
117 | file | 117 | file |
118 | .functions() | 118 | .functions() |