From 6cade3f6d8ad7bb5a11b1910689b25f709c12502 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Aug 2018 13:41:25 +0300 Subject: Runnig tests somehow --- crates/libeditor/src/typing.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'crates/libeditor/src/typing.rs') diff --git a/crates/libeditor/src/typing.rs b/crates/libeditor/src/typing.rs index 04021d164..cc0d3d272 100644 --- a/crates/libeditor/src/typing.rs +++ b/crates/libeditor/src/typing.rs @@ -5,6 +5,7 @@ use libsyntax2::{ walk::preorder, find_covering_node, }, + text_utils::intersect, SyntaxKind::*, }; @@ -53,16 +54,6 @@ pub fn join_lines(file: &ast::ParsedFile, range: TextRange) -> ActionResult { } } -fn intersect(r1: TextRange, r2: TextRange) -> Option { - let start = r1.start().max(r2.start()); - let end = r1.end().min(r2.end()); - if start <= end { - Some(TextRange::from_to(start, end)) - } else { - None - } -} - fn remove_newline( edit: &mut EditBuilder, node: SyntaxNodeRef, -- cgit v1.2.3