diff options
Diffstat (limited to 'crates/ra_syntax/src/parsing/reparsing.rs')
-rw-r--r-- | crates/ra_syntax/src/parsing/reparsing.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index cf27a3393..eeca94020 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs | |||
@@ -6,19 +6,20 @@ | |||
6 | //! - otherwise, we search for the nearest `{}` block which contains the edit | 6 | //! - otherwise, we search for the nearest `{}` block which contains the edit |
7 | //! and try to parse only this block. | 7 | //! and try to parse only this block. |
8 | 8 | ||
9 | use ra_text_edit::AtomTextEdit; | ||
10 | use ra_parser::Reparser; | 9 | use ra_parser::Reparser; |
10 | use ra_text_edit::AtomTextEdit; | ||
11 | 11 | ||
12 | use crate::{ | 12 | use crate::{ |
13 | SyntaxKind::*, TextRange, TextUnit, SyntaxError, | ||
14 | algo, | 13 | algo, |
15 | syntax_node::{GreenNode, SyntaxNode, GreenToken, SyntaxElement}, | ||
16 | parsing::{ | 14 | parsing::{ |
15 | lexer::{tokenize, Token}, | ||
17 | text_token_source::TextTokenSource, | 16 | text_token_source::TextTokenSource, |
18 | text_tree_sink::TextTreeSink, | 17 | text_tree_sink::TextTreeSink, |
19 | lexer::{tokenize, Token}, | ||
20 | }, | 18 | }, |
21 | T, | 19 | syntax_node::{GreenNode, GreenToken, SyntaxElement, SyntaxNode}, |
20 | SyntaxError, | ||
21 | SyntaxKind::*, | ||
22 | TextRange, TextUnit, T, | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | pub(crate) fn incremental_reparse( | 25 | pub(crate) fn incremental_reparse( |
@@ -168,10 +169,10 @@ fn merge_errors( | |||
168 | mod tests { | 169 | mod tests { |
169 | use std::sync::Arc; | 170 | use std::sync::Arc; |
170 | 171 | ||
171 | use test_utils::{extract_range, assert_eq_text}; | 172 | use test_utils::{assert_eq_text, extract_range}; |
172 | 173 | ||
173 | use crate::{SourceFile, AstNode, Parse}; | ||
174 | use super::*; | 174 | use super::*; |
175 | use crate::{AstNode, Parse, SourceFile}; | ||
175 | 176 | ||
176 | fn do_check(before: &str, replace_with: &str, reparsed_len: u32) { | 177 | fn do_check(before: &str, replace_with: &str, reparsed_len: u32) { |
177 | let (range, before) = extract_range(before); | 178 | let (range, before) = extract_range(before); |