diff options
author | Aleksey Kladov <[email protected]> | 2018-08-24 11:41:25 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-24 11:41:25 +0100 |
commit | 6cade3f6d8ad7bb5a11b1910689b25f709c12502 (patch) | |
tree | 96aea3209cc310462c37708d5623fe1f1d667634 /crates/libeditor/src | |
parent | 89e56c364f3d0a9d5a12ae488185abc1ea69df4a (diff) |
Runnig tests somehow
Diffstat (limited to 'crates/libeditor/src')
-rw-r--r-- | crates/libeditor/src/typing.rs | 11 |
1 files changed, 1 insertions, 10 deletions
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::{ | |||
5 | walk::preorder, | 5 | walk::preorder, |
6 | find_covering_node, | 6 | find_covering_node, |
7 | }, | 7 | }, |
8 | text_utils::intersect, | ||
8 | SyntaxKind::*, | 9 | SyntaxKind::*, |
9 | }; | 10 | }; |
10 | 11 | ||
@@ -53,16 +54,6 @@ pub fn join_lines(file: &ast::ParsedFile, range: TextRange) -> ActionResult { | |||
53 | } | 54 | } |
54 | } | 55 | } |
55 | 56 | ||
56 | fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> { | ||
57 | let start = r1.start().max(r2.start()); | ||
58 | let end = r1.end().min(r2.end()); | ||
59 | if start <= end { | ||
60 | Some(TextRange::from_to(start, end)) | ||
61 | } else { | ||
62 | None | ||
63 | } | ||
64 | } | ||
65 | |||
66 | fn remove_newline( | 57 | fn remove_newline( |
67 | edit: &mut EditBuilder, | 58 | edit: &mut EditBuilder, |
68 | node: SyntaxNodeRef, | 59 | node: SyntaxNodeRef, |