From 7afd84febc76a75a3ed1be75c57ff35d7b8b3de6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Aug 2018 12:28:59 +0300 Subject: visitor --- crates/libeditor/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/libeditor/src/lib.rs') 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; extern crate superslice; mod extend_selection; +mod symbols; mod line_index; use libsyntax2::{ - ast, + ast::{self, NameOwner}, SyntaxNodeRef, AstNode, algo::walk, SyntaxKind::*, }; pub use libsyntax2::{File, TextRange, TextUnit}; -pub use self::line_index::{LineIndex, LineCol}; +pub use self::{ + line_index::{LineIndex, LineCol}, + extend_selection::extend_selection, + symbols::{FileSymbol, file_symbols} +}; #[derive(Debug)] pub struct HighlightedRange { @@ -108,11 +113,6 @@ pub fn symbols(file: &ast::File) -> Vec { res // NLL :-( } -pub fn extend_selection(file: &ast::File, range: TextRange) -> Option { - let syntax = file.syntax(); - extend_selection::extend_selection(syntax.as_ref(), range) -} - pub fn runnables(file: &ast::File) -> Vec { file .functions() -- cgit v1.2.3