diff options
Diffstat (limited to 'crates/ra_syntax')
23 files changed, 72 insertions, 81 deletions
diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs index d31d00343..fad8da132 100644 --- a/crates/ra_syntax/src/algo.rs +++ b/crates/ra_syntax/src/algo.rs | |||
@@ -2,7 +2,7 @@ pub mod visit; | |||
2 | 2 | ||
3 | use itertools::Itertools; | 3 | use itertools::Itertools; |
4 | 4 | ||
5 | use crate::{SyntaxNode, TextRange, TextUnit, AstNode, Direction, SyntaxToken, SyntaxElement}; | 5 | use crate::{AstNode, Direction, SyntaxElement, SyntaxNode, SyntaxToken, TextRange, TextUnit}; |
6 | 6 | ||
7 | pub use rowan::TokenAtOffset; | 7 | pub use rowan::TokenAtOffset; |
8 | 8 | ||
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 319110b6a..3dcf39f7e 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -9,16 +9,16 @@ mod expr_extensions; | |||
9 | use std::marker::PhantomData; | 9 | use std::marker::PhantomData; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | syntax_node::{SyntaxNode, SyntaxNodeChildren, TreeArc, SyntaxToken}, | 12 | syntax_node::{SyntaxNode, SyntaxNodeChildren, SyntaxToken, TreeArc}, |
13 | SmolStr, | 13 | SmolStr, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | pub use self::{ | 16 | pub use self::{ |
17 | expr_extensions::{ArrayExprKind, BinOp, ElseBranch, LiteralKind, PrefixOp}, | ||
18 | extensions::{FieldKind, PathSegmentKind, SelfParamKind, StructKind}, | ||
17 | generated::*, | 19 | generated::*, |
18 | traits::*, | ||
19 | tokens::*, | 20 | tokens::*, |
20 | extensions::{PathSegmentKind, StructKind,FieldKind, SelfParamKind}, | 21 | traits::*, |
21 | expr_extensions::{ElseBranch, PrefixOp, BinOp, LiteralKind,ArrayExprKind}, | ||
22 | }; | 22 | }; |
23 | 23 | ||
24 | /// The main trait to go from untyped `SyntaxNode` to a typed ast. The | 24 | /// The main trait to go from untyped `SyntaxNode` to a typed ast. The |
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index d88671d45..87dbb0ea5 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | //! Various extension methods to ast Expr Nodes, which are hard to code-generate. | 1 | //! Various extension methods to ast Expr Nodes, which are hard to code-generate. |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | SyntaxToken, SyntaxElement, SmolStr, | 4 | ast::{self, child_opt, children, AstChildren, AstNode}, |
5 | ast::{self, AstNode, AstChildren, children, child_opt}, | 5 | SmolStr, SyntaxElement, |
6 | SyntaxKind::*, | 6 | SyntaxKind::*, |
7 | T | 7 | SyntaxToken, T, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | #[derive(Debug, Clone, PartialEq, Eq)] | 10 | #[derive(Debug, Clone, PartialEq, Eq)] |
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index 930b2d9fa..72a30232d 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs | |||
@@ -4,10 +4,10 @@ | |||
4 | use itertools::Itertools; | 4 | use itertools::Itertools; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | SmolStr, SyntaxToken, | 7 | ast::{self, child_opt, children, AstNode}, |
8 | ast::{self, AstNode, children, child_opt}, | 8 | SmolStr, SyntaxElement, |
9 | SyntaxKind::*, | 9 | SyntaxKind::*, |
10 | SyntaxElement, T, | 10 | SyntaxToken, T, |
11 | }; | 11 | }; |
12 | use ra_parser::SyntaxKind; | 12 | use ra_parser::SyntaxKind; |
13 | 13 | ||
diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index 08882ea69..be63b3c9e 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs | |||
@@ -1,9 +1,9 @@ | |||
1 | //! There are many AstNodes, but only a few tokens, so we hand-write them here. | 1 | //! There are many AstNodes, but only a few tokens, so we hand-write them here. |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | SyntaxToken, | ||
5 | SyntaxKind::{COMMENT, WHITESPACE}, | ||
6 | ast::AstToken, | 4 | ast::AstToken, |
5 | SyntaxKind::{COMMENT, WHITESPACE}, | ||
6 | SyntaxToken, | ||
7 | }; | 7 | }; |
8 | 8 | ||
9 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 9 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -61,7 +61,7 @@ pub enum CommentPlacement { | |||
61 | } | 61 | } |
62 | 62 | ||
63 | const COMMENT_PREFIX_TO_KIND: &[(&str, CommentKind)] = { | 63 | const COMMENT_PREFIX_TO_KIND: &[(&str, CommentKind)] = { |
64 | use {CommentShape::*, CommentPlacement::*}; | 64 | use {CommentPlacement::*, CommentShape::*}; |
65 | &[ | 65 | &[ |
66 | ("///", CommentKind { shape: Line, doc: Some(Outer) }), | 66 | ("///", CommentKind { shape: Line, doc: Some(Outer) }), |
67 | ("//!", CommentKind { shape: Line, doc: Some(Inner) }), | 67 | ("//!", CommentKind { shape: Line, doc: Some(Inner) }), |
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 433485400..29cb53e35 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -5,8 +5,8 @@ | |||
5 | use itertools::Itertools; | 5 | use itertools::Itertools; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | syntax_node::{SyntaxNodeChildren, SyntaxElementChildren}, | 8 | ast::{self, child_opt, children, AstChildren, AstNode, AstToken}, |
9 | ast::{self, child_opt, children, AstNode, AstToken, AstChildren}, | 9 | syntax_node::{SyntaxElementChildren, SyntaxNodeChildren}, |
10 | }; | 10 | }; |
11 | 11 | ||
12 | pub trait TypeAscriptionOwner: AstNode { | 12 | pub trait TypeAscriptionOwner: AstNode { |
diff --git a/crates/ra_syntax/src/fuzz.rs b/crates/ra_syntax/src/fuzz.rs index 6a9905bd1..6d114aad4 100644 --- a/crates/ra_syntax/src/fuzz.rs +++ b/crates/ra_syntax/src/fuzz.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use crate::{SourceFile, validation, TextUnit, TextRange, AstNode}; | 1 | use crate::{validation, AstNode, SourceFile, TextRange, TextUnit}; |
2 | use ra_text_edit::AtomTextEdit; | 2 | use ra_text_edit::AtomTextEdit; |
3 | use std::str::{self, FromStr}; | 3 | use std::str::{self, FromStr}; |
4 | 4 | ||
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index e46ad12db..9790a984d 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -31,23 +31,26 @@ pub mod ast; | |||
31 | #[doc(hidden)] | 31 | #[doc(hidden)] |
32 | pub mod fuzz; | 32 | pub mod fuzz; |
33 | 33 | ||
34 | use std::{sync::Arc, fmt::Write}; | 34 | use std::{fmt::Write, sync::Arc}; |
35 | 35 | ||
36 | use ra_text_edit::AtomTextEdit; | 36 | use ra_text_edit::AtomTextEdit; |
37 | 37 | ||
38 | use crate::syntax_node::GreenNode; | 38 | use crate::syntax_node::GreenNode; |
39 | 39 | ||
40 | pub use rowan::{SmolStr, TextRange, TextUnit}; | ||
41 | pub use ra_parser::SyntaxKind; | ||
42 | pub use ra_parser::T; | ||
43 | pub use crate::{ | 40 | pub use crate::{ |
44 | ast::AstNode, | 41 | ast::AstNode, |
45 | syntax_error::{SyntaxError, SyntaxErrorKind, Location}, | 42 | parsing::{classify_literal, tokenize, Token}, |
43 | ptr::{AstPtr, SyntaxNodePtr}, | ||
44 | syntax_error::{Location, SyntaxError, SyntaxErrorKind}, | ||
45 | syntax_node::{ | ||
46 | Direction, InsertPosition, SyntaxElement, SyntaxNode, SyntaxToken, SyntaxTreeBuilder, | ||
47 | TreeArc, WalkEvent, | ||
48 | }, | ||
46 | syntax_text::SyntaxText, | 49 | syntax_text::SyntaxText, |
47 | syntax_node::{Direction, SyntaxNode, WalkEvent, TreeArc, SyntaxTreeBuilder, SyntaxElement, SyntaxToken, InsertPosition}, | ||
48 | ptr::{SyntaxNodePtr, AstPtr}, | ||
49 | parsing::{tokenize, classify_literal, Token}, | ||
50 | }; | 50 | }; |
51 | pub use ra_parser::SyntaxKind; | ||
52 | pub use ra_parser::T; | ||
53 | pub use rowan::{SmolStr, TextRange, TextUnit}; | ||
51 | 54 | ||
52 | /// `Parse` is the result of the parsing: a syntax tree and a collection of | 55 | /// `Parse` is the result of the parsing: a syntax tree and a collection of |
53 | /// errors. | 56 | /// errors. |
diff --git a/crates/ra_syntax/src/parsing.rs b/crates/ra_syntax/src/parsing.rs index 4c1fa6c4f..0387f0378 100644 --- a/crates/ra_syntax/src/parsing.rs +++ b/crates/ra_syntax/src/parsing.rs | |||
@@ -6,12 +6,9 @@ mod text_token_source; | |||
6 | mod text_tree_sink; | 6 | mod text_tree_sink; |
7 | mod reparsing; | 7 | mod reparsing; |
8 | 8 | ||
9 | use crate::{ | 9 | use crate::{syntax_node::GreenNode, SyntaxError}; |
10 | SyntaxError, | ||
11 | syntax_node::GreenNode, | ||
12 | }; | ||
13 | 10 | ||
14 | pub use self::lexer::{tokenize, classify_literal, Token}; | 11 | pub use self::lexer::{classify_literal, tokenize, Token}; |
15 | 12 | ||
16 | pub(crate) use self::reparsing::incremental_reparse; | 13 | pub(crate) use self::reparsing::incremental_reparse; |
17 | 14 | ||
diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index 6eb96f03d..60cf37047 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs | |||
@@ -6,8 +6,7 @@ mod strings; | |||
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | SyntaxKind::{self, *}, | 8 | SyntaxKind::{self, *}, |
9 | TextUnit, | 9 | TextUnit, T, |
10 | T, | ||
11 | }; | 10 | }; |
12 | 11 | ||
13 | use self::{ | 12 | use self::{ |
diff --git a/crates/ra_syntax/src/parsing/lexer/numbers.rs b/crates/ra_syntax/src/parsing/lexer/numbers.rs index 874fb8b32..e53ae231b 100644 --- a/crates/ra_syntax/src/parsing/lexer/numbers.rs +++ b/crates/ra_syntax/src/parsing/lexer/numbers.rs | |||
@@ -1,7 +1,4 @@ | |||
1 | use crate::parsing::lexer::{ | 1 | use crate::parsing::lexer::{classes::*, ptr::Ptr}; |
2 | ptr::Ptr, | ||
3 | classes::*, | ||
4 | }; | ||
5 | 2 | ||
6 | use crate::SyntaxKind::{self, *}; | 3 | use crate::SyntaxKind::{self, *}; |
7 | 4 | ||
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); |
diff --git a/crates/ra_syntax/src/parsing/text_token_source.rs b/crates/ra_syntax/src/parsing/text_token_source.rs index 71d2947f7..f592b499f 100644 --- a/crates/ra_syntax/src/parsing/text_token_source.rs +++ b/crates/ra_syntax/src/parsing/text_token_source.rs | |||
@@ -1,10 +1,7 @@ | |||
1 | use ra_parser::TokenSource; | ||
2 | use ra_parser::Token as PToken; | 1 | use ra_parser::Token as PToken; |
2 | use ra_parser::TokenSource; | ||
3 | 3 | ||
4 | use crate::{ | 4 | use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextUnit}; |
5 | SyntaxKind::EOF, TextRange, TextUnit, | ||
6 | parsing::lexer::Token, | ||
7 | }; | ||
8 | 5 | ||
9 | pub(crate) struct TextTokenSource<'t> { | 6 | pub(crate) struct TextTokenSource<'t> { |
10 | text: &'t str, | 7 | text: &'t str, |
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index 71fc515f2..bf1b35c95 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs | |||
@@ -1,12 +1,13 @@ | |||
1 | use std::mem; | 1 | use std::mem; |
2 | 2 | ||
3 | use ra_parser::{TreeSink, ParseError}; | 3 | use ra_parser::{ParseError, TreeSink}; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | SmolStr, SyntaxError, TextUnit, TextRange, SyntaxTreeBuilder, | ||
7 | SyntaxKind::{self, *}, | ||
8 | parsing::Token, | 6 | parsing::Token, |
9 | syntax_node::GreenNode, | 7 | syntax_node::GreenNode, |
8 | SmolStr, SyntaxError, | ||
9 | SyntaxKind::{self, *}, | ||
10 | SyntaxTreeBuilder, TextRange, TextUnit, | ||
10 | }; | 11 | }; |
11 | 12 | ||
12 | /// Bridges the parser with our specific syntax tree representation. | 13 | /// Bridges the parser with our specific syntax tree representation. |
diff --git a/crates/ra_syntax/src/ptr.rs b/crates/ra_syntax/src/ptr.rs index 10cddb852..0550dca1a 100644 --- a/crates/ra_syntax/src/ptr.rs +++ b/crates/ra_syntax/src/ptr.rs | |||
@@ -1,10 +1,5 @@ | |||
1 | use std::{ | 1 | use crate::{AstNode, SyntaxKind, SyntaxNode, TextRange}; |
2 | marker::PhantomData, | 2 | use std::{iter::successors, marker::PhantomData}; |
3 | iter::successors, | ||
4 | }; | ||
5 | use crate::{ | ||
6 | AstNode, SyntaxKind, SyntaxNode, TextRange, | ||
7 | }; | ||
8 | 3 | ||
9 | /// A pointer to a syntax node inside a file. It can be used to remember a | 4 | /// A pointer to a syntax node inside a file. It can be used to remember a |
10 | /// specific node across reparses of the same file. | 5 | /// specific node across reparses of the same file. |
diff --git a/crates/ra_syntax/src/syntax_error.rs b/crates/ra_syntax/src/syntax_error.rs index d29c0cf6c..5aefec768 100644 --- a/crates/ra_syntax/src/syntax_error.rs +++ b/crates/ra_syntax/src/syntax_error.rs | |||
@@ -2,10 +2,7 @@ use std::fmt; | |||
2 | 2 | ||
3 | use ra_parser::ParseError; | 3 | use ra_parser::ParseError; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{validation::EscapeError, TextRange, TextUnit}; |
6 | TextRange, TextUnit, | ||
7 | validation::EscapeError, | ||
8 | }; | ||
9 | 6 | ||
10 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 7 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
11 | pub struct SyntaxError { | 8 | pub struct SyntaxError { |
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index 4105b5220..80c8639c8 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs | |||
@@ -7,18 +7,18 @@ | |||
7 | //! modules just wraps its API. | 7 | //! modules just wraps its API. |
8 | 8 | ||
9 | use std::{ | 9 | use std::{ |
10 | ops::RangeInclusive, | ||
11 | fmt::{self, Write}, | ||
12 | borrow::Borrow, | 10 | borrow::Borrow, |
11 | fmt::{self, Write}, | ||
13 | iter::successors, | 12 | iter::successors, |
13 | ops::RangeInclusive, | ||
14 | }; | 14 | }; |
15 | 15 | ||
16 | use ra_parser::ParseError; | 16 | use ra_parser::ParseError; |
17 | use rowan::{TransparentNewType, GreenNodeBuilder}; | 17 | use rowan::{GreenNodeBuilder, TransparentNewType}; |
18 | 18 | ||
19 | use crate::{ | 19 | use crate::{ |
20 | SmolStr, SyntaxKind, TextUnit, TextRange, SyntaxText, SourceFile, AstNode, SyntaxNodePtr, | ||
21 | syntax_error::{SyntaxError, SyntaxErrorKind}, | 20 | syntax_error::{SyntaxError, SyntaxErrorKind}, |
21 | AstNode, SmolStr, SourceFile, SyntaxKind, SyntaxNodePtr, SyntaxText, TextRange, TextUnit, | ||
22 | }; | 22 | }; |
23 | 23 | ||
24 | pub use rowan::WalkEvent; | 24 | pub use rowan::WalkEvent; |
diff --git a/crates/ra_syntax/src/syntax_text.rs b/crates/ra_syntax/src/syntax_text.rs index c9038cd5c..e648dc082 100644 --- a/crates/ra_syntax/src/syntax_text.rs +++ b/crates/ra_syntax/src/syntax_text.rs | |||
@@ -1,6 +1,9 @@ | |||
1 | use std::{fmt, ops::{self, Bound}}; | 1 | use std::{ |
2 | fmt, | ||
3 | ops::{self, Bound}, | ||
4 | }; | ||
2 | 5 | ||
3 | use crate::{SmolStr, SyntaxNode, TextRange, TextUnit, SyntaxElement}; | 6 | use crate::{SmolStr, SyntaxElement, SyntaxNode, TextRange, TextUnit}; |
4 | 7 | ||
5 | #[derive(Clone)] | 8 | #[derive(Clone)] |
6 | pub struct SyntaxText<'a> { | 9 | pub struct SyntaxText<'a> { |
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index b53900a4b..87522ec18 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs | |||
@@ -4,11 +4,10 @@ mod block; | |||
4 | mod field_expr; | 4 | mod field_expr; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | SourceFile, SyntaxError, AstNode, SyntaxNode, TextUnit, | ||
8 | SyntaxKind::{BYTE, BYTE_STRING, STRING, CHAR}, | ||
9 | ast, | ||
10 | algo::visit::{visitor_ctx, VisitorCtx}, | 7 | algo::visit::{visitor_ctx, VisitorCtx}, |
11 | T, | 8 | ast, AstNode, SourceFile, SyntaxError, |
9 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, STRING}, | ||
10 | SyntaxNode, TextUnit, T, | ||
12 | }; | 11 | }; |
13 | 12 | ||
14 | pub(crate) use unescape::EscapeError; | 13 | pub(crate) use unescape::EscapeError; |
diff --git a/crates/ra_syntax/src/validation/block.rs b/crates/ra_syntax/src/validation/block.rs index f2cf3cbbd..46650d9b0 100644 --- a/crates/ra_syntax/src/validation/block.rs +++ b/crates/ra_syntax/src/validation/block.rs | |||
@@ -1,7 +1,8 @@ | |||
1 | use crate::{SyntaxKind::*, | 1 | use crate::{ |
2 | ast::{self, AttrsOwner, AstNode}, | 2 | ast::{self, AstNode, AttrsOwner}, |
3 | SyntaxError, | 3 | SyntaxError, |
4 | SyntaxErrorKind::*, | 4 | SyntaxErrorKind::*, |
5 | SyntaxKind::*, | ||
5 | }; | 6 | }; |
6 | 7 | ||
7 | pub(crate) fn validate_block_node(node: &ast::Block, errors: &mut Vec<SyntaxError>) { | 8 | pub(crate) fn validate_block_node(node: &ast::Block, errors: &mut Vec<SyntaxError>) { |
diff --git a/crates/ra_syntax/src/validation/field_expr.rs b/crates/ra_syntax/src/validation/field_expr.rs index 2b405062e..d3020edf7 100644 --- a/crates/ra_syntax/src/validation/field_expr.rs +++ b/crates/ra_syntax/src/validation/field_expr.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | use crate::{ast::{self, FieldKind}, | 1 | use crate::{ |
2 | SyntaxError, | 2 | ast::{self, FieldKind}, |
3 | SyntaxErrorKind::*, | 3 | SyntaxError, |
4 | SyntaxErrorKind::*, | ||
4 | }; | 5 | }; |
5 | 6 | ||
6 | pub(crate) fn validate_field_expr_node(node: &ast::FieldExpr, errors: &mut Vec<SyntaxError>) { | 7 | pub(crate) fn validate_field_expr_node(node: &ast::FieldExpr, errors: &mut Vec<SyntaxError>) { |
diff --git a/crates/ra_syntax/src/validation/unescape.rs b/crates/ra_syntax/src/validation/unescape.rs index 91dbcfae8..4c3a7effc 100644 --- a/crates/ra_syntax/src/validation/unescape.rs +++ b/crates/ra_syntax/src/validation/unescape.rs | |||
@@ -7,8 +7,8 @@ | |||
7 | //! | 7 | //! |
8 | //! Hopefully, we'll share this code in a proper way some day | 8 | //! Hopefully, we'll share this code in a proper way some day |
9 | 9 | ||
10 | use std::str::Chars; | ||
11 | use std::ops::Range; | 10 | use std::ops::Range; |
11 | use std::str::Chars; | ||
12 | 12 | ||
13 | #[derive(Debug, PartialEq, Eq, Clone, Hash)] | 13 | #[derive(Debug, PartialEq, Eq, Clone, Hash)] |
14 | pub enum EscapeError { | 14 | pub enum EscapeError { |
diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs index f31e12588..2442c8505 100644 --- a/crates/ra_syntax/tests/test.rs +++ b/crates/ra_syntax/tests/test.rs | |||
@@ -4,11 +4,11 @@ extern crate walkdir; | |||
4 | 4 | ||
5 | use std::{ | 5 | use std::{ |
6 | fmt::Write, | 6 | fmt::Write, |
7 | path::{PathBuf, Component}, | 7 | path::{Component, PathBuf}, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | use test_utils::{project_dir, dir_tests, read_text, collect_tests}; | 10 | use ra_syntax::{fuzz, SourceFile}; |
11 | use ra_syntax::{SourceFile, fuzz}; | 11 | use test_utils::{collect_tests, dir_tests, project_dir, read_text}; |
12 | 12 | ||
13 | #[test] | 13 | #[test] |
14 | fn lexer_tests() { | 14 | fn lexer_tests() { |