diff options
author | Aleksey Kladov <[email protected]> | 2020-08-12 17:26:51 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-08-12 17:30:53 +0100 |
commit | a1c187eef3ba08076aedb5154929f7eda8d1b424 (patch) | |
tree | 9d898eb9600b0c36a74e4f95238f679c683fa566 /crates/ra_assists/src | |
parent | 3d6889cba72a9d02199f7adaa2ecc69bc30af834 (diff) |
Rename ra_syntax -> syntax
Diffstat (limited to 'crates/ra_assists/src')
45 files changed, 60 insertions, 66 deletions
diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs index fcaa1aedc..217f692a4 100644 --- a/crates/ra_assists/src/assist_context.rs +++ b/crates/ra_assists/src/assist_context.rs | |||
@@ -10,7 +10,7 @@ use ra_ide_db::{ | |||
10 | source_change::{SourceChange, SourceFileEdit}, | 10 | source_change::{SourceChange, SourceFileEdit}, |
11 | RootDatabase, | 11 | RootDatabase, |
12 | }; | 12 | }; |
13 | use ra_syntax::{ | 13 | use syntax::{ |
14 | algo::{self, find_node_at_offset, SyntaxRewriter}, | 14 | algo::{self, find_node_at_offset, SyntaxRewriter}, |
15 | AstNode, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize, | 15 | AstNode, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize, |
16 | TokenAtOffset, | 16 | TokenAtOffset, |
@@ -271,7 +271,7 @@ impl AssistBuilder { | |||
271 | } | 271 | } |
272 | /// Replaces specified `node` of text with a given string, reindenting the | 272 | /// Replaces specified `node` of text with a given string, reindenting the |
273 | /// string to maintain `node`'s existing indent. | 273 | /// string to maintain `node`'s existing indent. |
274 | // FIXME: remove in favor of ra_syntax::edit::IndentLevel::increase_indent | 274 | // FIXME: remove in favor of syntax::edit::IndentLevel::increase_indent |
275 | pub(crate) fn replace_node_and_indent( | 275 | pub(crate) fn replace_node_and_indent( |
276 | &mut self, | 276 | &mut self, |
277 | node: &SyntaxNode, | 277 | node: &SyntaxNode, |
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs index 07c978378..4c41c16d8 100644 --- a/crates/ra_assists/src/ast_transform.rs +++ b/crates/ra_assists/src/ast_transform.rs | |||
@@ -2,13 +2,13 @@ | |||
2 | use rustc_hash::FxHashMap; | 2 | use rustc_hash::FxHashMap; |
3 | 3 | ||
4 | use hir::{HirDisplay, PathResolution, SemanticsScope}; | 4 | use hir::{HirDisplay, PathResolution, SemanticsScope}; |
5 | use ra_syntax::{ | 5 | use syntax::{ |
6 | algo::SyntaxRewriter, | 6 | algo::SyntaxRewriter, |
7 | ast::{self, AstNode}, | 7 | ast::{self, AstNode}, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | pub trait AstTransform<'a> { | 10 | pub trait AstTransform<'a> { |
11 | fn get_substitution(&self, node: &ra_syntax::SyntaxNode) -> Option<ra_syntax::SyntaxNode>; | 11 | fn get_substitution(&self, node: &syntax::SyntaxNode) -> Option<syntax::SyntaxNode>; |
12 | 12 | ||
13 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a>; | 13 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a>; |
14 | fn or<T: AstTransform<'a> + 'a>(self, other: T) -> Box<dyn AstTransform<'a> + 'a> | 14 | fn or<T: AstTransform<'a> + 'a>(self, other: T) -> Box<dyn AstTransform<'a> + 'a> |
@@ -22,7 +22,7 @@ pub trait AstTransform<'a> { | |||
22 | struct NullTransformer; | 22 | struct NullTransformer; |
23 | 23 | ||
24 | impl<'a> AstTransform<'a> for NullTransformer { | 24 | impl<'a> AstTransform<'a> for NullTransformer { |
25 | fn get_substitution(&self, _node: &ra_syntax::SyntaxNode) -> Option<ra_syntax::SyntaxNode> { | 25 | fn get_substitution(&self, _node: &syntax::SyntaxNode) -> Option<syntax::SyntaxNode> { |
26 | None | 26 | None |
27 | } | 27 | } |
28 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a> { | 28 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a> { |
@@ -101,10 +101,7 @@ impl<'a> SubstituteTypeParams<'a> { | |||
101 | Some(result) | 101 | Some(result) |
102 | } | 102 | } |
103 | } | 103 | } |
104 | fn get_substitution_inner( | 104 | fn get_substitution_inner(&self, node: &syntax::SyntaxNode) -> Option<syntax::SyntaxNode> { |
105 | &self, | ||
106 | node: &ra_syntax::SyntaxNode, | ||
107 | ) -> Option<ra_syntax::SyntaxNode> { | ||
108 | let type_ref = ast::Type::cast(node.clone())?; | 105 | let type_ref = ast::Type::cast(node.clone())?; |
109 | let path = match &type_ref { | 106 | let path = match &type_ref { |
110 | ast::Type::PathType(path_type) => path_type.path()?, | 107 | ast::Type::PathType(path_type) => path_type.path()?, |
@@ -122,7 +119,7 @@ impl<'a> SubstituteTypeParams<'a> { | |||
122 | } | 119 | } |
123 | 120 | ||
124 | impl<'a> AstTransform<'a> for SubstituteTypeParams<'a> { | 121 | impl<'a> AstTransform<'a> for SubstituteTypeParams<'a> { |
125 | fn get_substitution(&self, node: &ra_syntax::SyntaxNode) -> Option<ra_syntax::SyntaxNode> { | 122 | fn get_substitution(&self, node: &syntax::SyntaxNode) -> Option<syntax::SyntaxNode> { |
126 | self.get_substitution_inner(node).or_else(|| self.previous.get_substitution(node)) | 123 | self.get_substitution_inner(node).or_else(|| self.previous.get_substitution(node)) |
127 | } | 124 | } |
128 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a> { | 125 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a> { |
@@ -141,10 +138,7 @@ impl<'a> QualifyPaths<'a> { | |||
141 | Self { target_scope, source_scope, previous: Box::new(NullTransformer) } | 138 | Self { target_scope, source_scope, previous: Box::new(NullTransformer) } |
142 | } | 139 | } |
143 | 140 | ||
144 | fn get_substitution_inner( | 141 | fn get_substitution_inner(&self, node: &syntax::SyntaxNode) -> Option<syntax::SyntaxNode> { |
145 | &self, | ||
146 | node: &ra_syntax::SyntaxNode, | ||
147 | ) -> Option<ra_syntax::SyntaxNode> { | ||
148 | // FIXME handle value ns? | 142 | // FIXME handle value ns? |
149 | let from = self.target_scope.module()?; | 143 | let from = self.target_scope.module()?; |
150 | let p = ast::Path::cast(node.clone())?; | 144 | let p = ast::Path::cast(node.clone())?; |
@@ -183,7 +177,7 @@ impl<'a> QualifyPaths<'a> { | |||
183 | 177 | ||
184 | pub fn apply<'a, N: AstNode>(transformer: &dyn AstTransform<'a>, node: N) -> N { | 178 | pub fn apply<'a, N: AstNode>(transformer: &dyn AstTransform<'a>, node: N) -> N { |
185 | SyntaxRewriter::from_fn(|element| match element { | 179 | SyntaxRewriter::from_fn(|element| match element { |
186 | ra_syntax::SyntaxElement::Node(n) => { | 180 | syntax::SyntaxElement::Node(n) => { |
187 | let replacement = transformer.get_substitution(&n)?; | 181 | let replacement = transformer.get_substitution(&n)?; |
188 | Some(replacement.into()) | 182 | Some(replacement.into()) |
189 | } | 183 | } |
@@ -193,7 +187,7 @@ pub fn apply<'a, N: AstNode>(transformer: &dyn AstTransform<'a>, node: N) -> N { | |||
193 | } | 187 | } |
194 | 188 | ||
195 | impl<'a> AstTransform<'a> for QualifyPaths<'a> { | 189 | impl<'a> AstTransform<'a> for QualifyPaths<'a> { |
196 | fn get_substitution(&self, node: &ra_syntax::SyntaxNode) -> Option<ra_syntax::SyntaxNode> { | 190 | fn get_substitution(&self, node: &syntax::SyntaxNode) -> Option<syntax::SyntaxNode> { |
197 | self.get_substitution_inner(node).or_else(|| self.previous.get_substitution(node)) | 191 | self.get_substitution_inner(node).or_else(|| self.previous.get_substitution(node)) |
198 | } | 192 | } |
199 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a> { | 193 | fn chain_before(self, other: Box<dyn AstTransform<'a> + 'a>) -> Box<dyn AstTransform<'a> + 'a> { |
diff --git a/crates/ra_assists/src/handlers/add_custom_impl.rs b/crates/ra_assists/src/handlers/add_custom_impl.rs index ebdf00e67..8757fa33f 100644 --- a/crates/ra_assists/src/handlers/add_custom_impl.rs +++ b/crates/ra_assists/src/handlers/add_custom_impl.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use itertools::Itertools; | 1 | use itertools::Itertools; |
2 | use ra_syntax::{ | 2 | use syntax::{ |
3 | ast::{self, AstNode}, | 3 | ast::{self, AstNode}, |
4 | Direction, SmolStr, | 4 | Direction, SmolStr, |
5 | SyntaxKind::{IDENT, WHITESPACE}, | 5 | SyntaxKind::{IDENT, WHITESPACE}, |
diff --git a/crates/ra_assists/src/handlers/add_explicit_type.rs b/crates/ra_assists/src/handlers/add_explicit_type.rs index 135a2ac9c..563cbf505 100644 --- a/crates/ra_assists/src/handlers/add_explicit_type.rs +++ b/crates/ra_assists/src/handlers/add_explicit_type.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use hir::HirDisplay; | 1 | use hir::HirDisplay; |
2 | use ra_syntax::{ | 2 | use syntax::{ |
3 | ast::{self, AstNode, LetStmt, NameOwner}, | 3 | ast::{self, AstNode, LetStmt, NameOwner}, |
4 | TextRange, | 4 | TextRange, |
5 | }; | 5 | }; |
diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs index dd1406228..81b61ebf8 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use hir::HasSource; | 1 | use hir::HasSource; |
2 | use ra_syntax::{ | 2 | use syntax::{ |
3 | ast::{ | 3 | ast::{ |
4 | self, | 4 | self, |
5 | edit::{self, AstNodeEdit, IndentLevel}, | 5 | edit::{self, AstNodeEdit, IndentLevel}, |
diff --git a/crates/ra_assists/src/handlers/add_turbo_fish.rs b/crates/ra_assists/src/handlers/add_turbo_fish.rs index 537322a72..8c7ffae3d 100644 --- a/crates/ra_assists/src/handlers/add_turbo_fish.rs +++ b/crates/ra_assists/src/handlers/add_turbo_fish.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ra_ide_db::defs::{classify_name_ref, Definition, NameRefClass}; | 1 | use ra_ide_db::defs::{classify_name_ref, Definition, NameRefClass}; |
2 | use ra_syntax::{ast, AstNode, SyntaxKind, T}; | 2 | use syntax::{ast, AstNode, SyntaxKind, T}; |
3 | use test_utils::mark; | 3 | use test_utils::mark; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
diff --git a/crates/ra_assists/src/handlers/apply_demorgan.rs b/crates/ra_assists/src/handlers/apply_demorgan.rs index 3ac4aed7d..1a6fdafda 100644 --- a/crates/ra_assists/src/handlers/apply_demorgan.rs +++ b/crates/ra_assists/src/handlers/apply_demorgan.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::ast::{self, AstNode}; | 1 | use syntax::ast::{self, AstNode}; |
2 | 2 | ||
3 | use crate::{utils::invert_boolean_expression, AssistContext, AssistId, AssistKind, Assists}; | 3 | use crate::{utils::invert_boolean_expression, AssistContext, AssistId, AssistKind, Assists}; |
4 | 4 | ||
diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs index 6ec59ec4d..e19b197d9 100644 --- a/crates/ra_assists/src/handlers/auto_import.rs +++ b/crates/ra_assists/src/handlers/auto_import.rs | |||
@@ -6,11 +6,11 @@ use hir::{ | |||
6 | Type, | 6 | Type, |
7 | }; | 7 | }; |
8 | use ra_ide_db::{imports_locator, RootDatabase}; | 8 | use ra_ide_db::{imports_locator, RootDatabase}; |
9 | use ra_syntax::{ | 9 | use rustc_hash::FxHashSet; |
10 | use syntax::{ | ||
10 | ast::{self, AstNode}, | 11 | ast::{self, AstNode}, |
11 | SyntaxNode, | 12 | SyntaxNode, |
12 | }; | 13 | }; |
13 | use rustc_hash::FxHashSet; | ||
14 | 14 | ||
15 | use crate::{ | 15 | use crate::{ |
16 | utils::insert_use_statement, AssistContext, AssistId, AssistKind, Assists, GroupLabel, | 16 | utils::insert_use_statement, AssistContext, AssistId, AssistKind, Assists, GroupLabel, |
diff --git a/crates/ra_assists/src/handlers/change_return_type_to_result.rs b/crates/ra_assists/src/handlers/change_return_type_to_result.rs index b83c94404..d5a68a24c 100644 --- a/crates/ra_assists/src/handlers/change_return_type_to_result.rs +++ b/crates/ra_assists/src/handlers/change_return_type_to_result.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{self, BlockExpr, Expr, LoopBodyOwner}, | 2 | ast::{self, BlockExpr, Expr, LoopBodyOwner}, |
3 | AstNode, SyntaxNode, | 3 | AstNode, SyntaxNode, |
4 | }; | 4 | }; |
diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs index 724daa93f..32dc05378 100644 --- a/crates/ra_assists/src/handlers/change_visibility.rs +++ b/crates/ra_assists/src/handlers/change_visibility.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{self, NameOwner, VisibilityOwner}, | 2 | ast::{self, NameOwner, VisibilityOwner}, |
3 | AstNode, | 3 | AstNode, |
4 | SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT, VISIBILITY}, | 4 | SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT, VISIBILITY}, |
diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs index 6816a2709..7fd78e9d4 100644 --- a/crates/ra_assists/src/handlers/early_return.rs +++ b/crates/ra_assists/src/handlers/early_return.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::{iter::once, ops::RangeInclusive}; | 1 | use std::{iter::once, ops::RangeInclusive}; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use syntax::{ |
4 | algo::replace_children, | 4 | algo::replace_children, |
5 | ast::{ | 5 | ast::{ |
6 | self, | 6 | self, |
diff --git a/crates/ra_assists/src/handlers/expand_glob_import.rs b/crates/ra_assists/src/handlers/expand_glob_import.rs index eb216a81a..cf34ffaf7 100644 --- a/crates/ra_assists/src/handlers/expand_glob_import.rs +++ b/crates/ra_assists/src/handlers/expand_glob_import.rs | |||
@@ -3,7 +3,7 @@ use ra_ide_db::{ | |||
3 | defs::{classify_name_ref, Definition, NameRefClass}, | 3 | defs::{classify_name_ref, Definition, NameRefClass}, |
4 | RootDatabase, | 4 | RootDatabase, |
5 | }; | 5 | }; |
6 | use ra_syntax::{algo, ast, match_ast, AstNode, SyntaxNode, SyntaxToken, T}; | 6 | use syntax::{algo, ast, match_ast, AstNode, SyntaxNode, SyntaxToken, T}; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | assist_context::{AssistBuilder, AssistContext, Assists}, | 9 | assist_context::{AssistBuilder, AssistContext, Assists}, |
diff --git a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs index ccec688ca..6e9f2d0fc 100644 --- a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs | |||
@@ -2,12 +2,12 @@ use hir::{EnumVariant, Module, ModuleDef, Name}; | |||
2 | use ra_db::FileId; | 2 | use ra_db::FileId; |
3 | use ra_fmt::leading_indent; | 3 | use ra_fmt::leading_indent; |
4 | use ra_ide_db::{defs::Definition, search::Reference, RootDatabase}; | 4 | use ra_ide_db::{defs::Definition, search::Reference, RootDatabase}; |
5 | use ra_syntax::{ | 5 | use rustc_hash::FxHashSet; |
6 | use syntax::{ | ||
6 | algo::find_node_at_offset, | 7 | algo::find_node_at_offset, |
7 | ast::{self, ArgListOwner, AstNode, NameOwner, VisibilityOwner}, | 8 | ast::{self, ArgListOwner, AstNode, NameOwner, VisibilityOwner}, |
8 | SourceFile, SyntaxNode, TextRange, TextSize, | 9 | SourceFile, SyntaxNode, TextRange, TextSize, |
9 | }; | 10 | }; |
10 | use rustc_hash::FxHashSet; | ||
11 | 11 | ||
12 | use crate::{ | 12 | use crate::{ |
13 | assist_context::AssistBuilder, utils::insert_use_statement, AssistContext, AssistId, | 13 | assist_context::AssistBuilder, utils::insert_use_statement, AssistContext, AssistId, |
diff --git a/crates/ra_assists/src/handlers/extract_variable.rs b/crates/ra_assists/src/handlers/extract_variable.rs index cc62db0c4..d2ae137cd 100644 --- a/crates/ra_assists/src/handlers/extract_variable.rs +++ b/crates/ra_assists/src/handlers/extract_variable.rs | |||
@@ -1,11 +1,11 @@ | |||
1 | use ra_syntax::{ | 1 | use stdx::format_to; |
2 | use syntax::{ | ||
2 | ast::{self, AstNode}, | 3 | ast::{self, AstNode}, |
3 | SyntaxKind::{ | 4 | SyntaxKind::{ |
4 | BLOCK_EXPR, BREAK_EXPR, CLOSURE_EXPR, COMMENT, LOOP_EXPR, MATCH_ARM, PATH_EXPR, RETURN_EXPR, | 5 | BLOCK_EXPR, BREAK_EXPR, CLOSURE_EXPR, COMMENT, LOOP_EXPR, MATCH_ARM, PATH_EXPR, RETURN_EXPR, |
5 | }, | 6 | }, |
6 | SyntaxNode, | 7 | SyntaxNode, |
7 | }; | 8 | }; |
8 | use stdx::format_to; | ||
9 | use test_utils::mark; | 9 | use test_utils::mark; |
10 | 10 | ||
11 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 11 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
diff --git a/crates/ra_assists/src/handlers/fill_match_arms.rs b/crates/ra_assists/src/handlers/fill_match_arms.rs index 6698d1a27..8f6660637 100644 --- a/crates/ra_assists/src/handlers/fill_match_arms.rs +++ b/crates/ra_assists/src/handlers/fill_match_arms.rs | |||
@@ -3,7 +3,7 @@ use std::iter; | |||
3 | use hir::{Adt, HasSource, ModuleDef, Semantics}; | 3 | use hir::{Adt, HasSource, ModuleDef, Semantics}; |
4 | use itertools::Itertools; | 4 | use itertools::Itertools; |
5 | use ra_ide_db::RootDatabase; | 5 | use ra_ide_db::RootDatabase; |
6 | use ra_syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat}; | 6 | use syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat}; |
7 | use test_utils::mark; | 7 | use test_utils::mark; |
8 | 8 | ||
9 | use crate::{ | 9 | use crate::{ |
diff --git a/crates/ra_assists/src/handlers/fix_visibility.rs b/crates/ra_assists/src/handlers/fix_visibility.rs index a19dbf33f..b6cc1a320 100644 --- a/crates/ra_assists/src/handlers/fix_visibility.rs +++ b/crates/ra_assists/src/handlers/fix_visibility.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution}; | 1 | use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution}; |
2 | use ra_db::FileId; | 2 | use ra_db::FileId; |
3 | use ra_syntax::{ast, AstNode, TextRange, TextSize}; | 3 | use syntax::{ast, AstNode, TextRange, TextSize}; |
4 | 4 | ||
5 | use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; | 5 | use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; |
6 | use ast::VisibilityOwner; | 6 | use ast::VisibilityOwner; |
diff --git a/crates/ra_assists/src/handlers/flip_binexpr.rs b/crates/ra_assists/src/handlers/flip_binexpr.rs index 3cd532650..404f06133 100644 --- a/crates/ra_assists/src/handlers/flip_binexpr.rs +++ b/crates/ra_assists/src/handlers/flip_binexpr.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::ast::{AstNode, BinExpr, BinOp}; | 1 | use syntax::ast::{AstNode, BinExpr, BinOp}; |
2 | 2 | ||
3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
4 | 4 | ||
diff --git a/crates/ra_assists/src/handlers/flip_comma.rs b/crates/ra_assists/src/handlers/flip_comma.rs index 55a971dc7..5c69db53e 100644 --- a/crates/ra_assists/src/handlers/flip_comma.rs +++ b/crates/ra_assists/src/handlers/flip_comma.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{algo::non_trivia_sibling, Direction, T}; | 1 | use syntax::{algo::non_trivia_sibling, Direction, T}; |
2 | 2 | ||
3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
4 | 4 | ||
diff --git a/crates/ra_assists/src/handlers/flip_trait_bound.rs b/crates/ra_assists/src/handlers/flip_trait_bound.rs index 1234f4d29..347e79b1d 100644 --- a/crates/ra_assists/src/handlers/flip_trait_bound.rs +++ b/crates/ra_assists/src/handlers/flip_trait_bound.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | algo::non_trivia_sibling, | 2 | algo::non_trivia_sibling, |
3 | ast::{self, AstNode}, | 3 | ast::{self, AstNode}, |
4 | Direction, T, | 4 | Direction, T, |
diff --git a/crates/ra_assists/src/handlers/generate_derive.rs b/crates/ra_assists/src/handlers/generate_derive.rs index 90ece9fab..314504e15 100644 --- a/crates/ra_assists/src/handlers/generate_derive.rs +++ b/crates/ra_assists/src/handlers/generate_derive.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{self, AstNode, AttrsOwner}, | 2 | ast::{self, AstNode, AttrsOwner}, |
3 | SyntaxKind::{COMMENT, WHITESPACE}, | 3 | SyntaxKind::{COMMENT, WHITESPACE}, |
4 | TextSize, | 4 | TextSize, |
diff --git a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs index 4c1aef8a2..302b6b67d 100644 --- a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs +++ b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ra_ide_db::RootDatabase; | 1 | use ra_ide_db::RootDatabase; |
2 | use ra_syntax::ast::{self, AstNode, NameOwner}; | 2 | use syntax::ast::{self, AstNode, NameOwner}; |
3 | use test_utils::mark; | 3 | use test_utils::mark; |
4 | 4 | ||
5 | use crate::{utils::FamousDefs, AssistContext, AssistId, AssistKind, Assists}; | 5 | use crate::{utils::FamousDefs, AssistContext, AssistId, AssistKind, Assists}; |
diff --git a/crates/ra_assists/src/handlers/generate_function.rs b/crates/ra_assists/src/handlers/generate_function.rs index acc97e648..b5df44101 100644 --- a/crates/ra_assists/src/handlers/generate_function.rs +++ b/crates/ra_assists/src/handlers/generate_function.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | use hir::HirDisplay; | 1 | use hir::HirDisplay; |
2 | use ra_db::FileId; | 2 | use ra_db::FileId; |
3 | use ra_syntax::{ | 3 | use rustc_hash::{FxHashMap, FxHashSet}; |
4 | use syntax::{ | ||
4 | ast::{ | 5 | ast::{ |
5 | self, | 6 | self, |
6 | edit::{AstNodeEdit, IndentLevel}, | 7 | edit::{AstNodeEdit, IndentLevel}, |
@@ -8,7 +9,6 @@ use ra_syntax::{ | |||
8 | }, | 9 | }, |
9 | SyntaxKind, SyntaxNode, TextSize, | 10 | SyntaxKind, SyntaxNode, TextSize, |
10 | }; | 11 | }; |
11 | use rustc_hash::{FxHashMap, FxHashSet}; | ||
12 | 12 | ||
13 | use crate::{ | 13 | use crate::{ |
14 | assist_config::SnippetCap, | 14 | assist_config::SnippetCap, |
diff --git a/crates/ra_assists/src/handlers/generate_impl.rs b/crates/ra_assists/src/handlers/generate_impl.rs index 7162dc184..9989109b5 100644 --- a/crates/ra_assists/src/handlers/generate_impl.rs +++ b/crates/ra_assists/src/handlers/generate_impl.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use itertools::Itertools; | 1 | use itertools::Itertools; |
2 | use ra_syntax::ast::{self, AstNode, GenericParamsOwner, NameOwner}; | ||
3 | use stdx::format_to; | 2 | use stdx::format_to; |
3 | use syntax::ast::{self, AstNode, GenericParamsOwner, NameOwner}; | ||
4 | 4 | ||
5 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 5 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
6 | 6 | ||
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index 32dfed274..7db10f276 100644 --- a/crates/ra_assists/src/handlers/generate_new.rs +++ b/crates/ra_assists/src/handlers/generate_new.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | use hir::Adt; | 1 | use hir::Adt; |
2 | use itertools::Itertools; | 2 | use itertools::Itertools; |
3 | use ra_syntax::{ | 3 | use stdx::format_to; |
4 | use syntax::{ | ||
4 | ast::{self, AstNode, GenericParamsOwner, NameOwner, StructKind, VisibilityOwner}, | 5 | ast::{self, AstNode, GenericParamsOwner, NameOwner, StructKind, VisibilityOwner}, |
5 | T, | 6 | T, |
6 | }; | 7 | }; |
7 | use stdx::format_to; | ||
8 | 8 | ||
9 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 9 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
10 | 10 | ||
diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs index 3c58020f8..531592320 100644 --- a/crates/ra_assists/src/handlers/inline_local_variable.rs +++ b/crates/ra_assists/src/handlers/inline_local_variable.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ra_ide_db::defs::Definition; | 1 | use ra_ide_db::defs::Definition; |
2 | use ra_syntax::{ | 2 | use syntax::{ |
3 | ast::{self, AstNode, AstToken}, | 3 | ast::{self, AstNode, AstToken}, |
4 | TextRange, | 4 | TextRange, |
5 | }; | 5 | }; |
diff --git a/crates/ra_assists/src/handlers/introduce_named_lifetime.rs b/crates/ra_assists/src/handlers/introduce_named_lifetime.rs index fbaf3c06b..5f623e5f7 100644 --- a/crates/ra_assists/src/handlers/introduce_named_lifetime.rs +++ b/crates/ra_assists/src/handlers/introduce_named_lifetime.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use ra_syntax::{ | 1 | use rustc_hash::FxHashSet; |
2 | use syntax::{ | ||
2 | ast::{self, GenericParamsOwner, NameOwner}, | 3 | ast::{self, GenericParamsOwner, NameOwner}, |
3 | AstNode, SyntaxKind, TextRange, TextSize, | 4 | AstNode, SyntaxKind, TextRange, TextSize, |
4 | }; | 5 | }; |
5 | use rustc_hash::FxHashSet; | ||
6 | 6 | ||
7 | use crate::{assist_context::AssistBuilder, AssistContext, AssistId, AssistKind, Assists}; | 7 | use crate::{assist_context::AssistBuilder, AssistContext, AssistId, AssistKind, Assists}; |
8 | 8 | ||
diff --git a/crates/ra_assists/src/handlers/invert_if.rs b/crates/ra_assists/src/handlers/invert_if.rs index bbe3f3643..f0e047538 100644 --- a/crates/ra_assists/src/handlers/invert_if.rs +++ b/crates/ra_assists/src/handlers/invert_if.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{self, AstNode}, | 2 | ast::{self, AstNode}, |
3 | T, | 3 | T, |
4 | }; | 4 | }; |
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index c775fe25c..9c5c6eda7 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::iter::successors; | 1 | use std::iter::successors; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use syntax::{ |
4 | algo::{neighbor, skip_trivia_token, SyntaxRewriter}, | 4 | algo::{neighbor, skip_trivia_token, SyntaxRewriter}, |
5 | ast::{self, edit::AstNodeEdit, make}, | 5 | ast::{self, edit::AstNodeEdit, make}, |
6 | AstNode, Direction, InsertPosition, SyntaxElement, T, | 6 | AstNode, Direction, InsertPosition, SyntaxElement, T, |
diff --git a/crates/ra_assists/src/handlers/merge_match_arms.rs b/crates/ra_assists/src/handlers/merge_match_arms.rs index 563292282..c347eb40e 100644 --- a/crates/ra_assists/src/handlers/merge_match_arms.rs +++ b/crates/ra_assists/src/handlers/merge_match_arms.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::iter::successors; | 1 | use std::iter::successors; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use syntax::{ |
4 | algo::neighbor, | 4 | algo::neighbor, |
5 | ast::{self, AstNode}, | 5 | ast::{self, AstNode}, |
6 | Direction, | 6 | Direction, |
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index 6d394443e..e2e461520 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{self, edit::AstNodeEdit, make, AstNode, NameOwner, TypeBoundsOwner}, | 2 | ast::{self, edit::AstNodeEdit, make, AstNode, NameOwner, TypeBoundsOwner}, |
3 | match_ast, | 3 | match_ast, |
4 | SyntaxKind::*, | 4 | SyntaxKind::*, |
diff --git a/crates/ra_assists/src/handlers/move_guard.rs b/crates/ra_assists/src/handlers/move_guard.rs index 4060d34c6..c62ebc306 100644 --- a/crates/ra_assists/src/handlers/move_guard.rs +++ b/crates/ra_assists/src/handlers/move_guard.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{AstNode, IfExpr, MatchArm}, | 2 | ast::{AstNode, IfExpr, MatchArm}, |
3 | SyntaxKind::WHITESPACE, | 3 | SyntaxKind::WHITESPACE, |
4 | }; | 4 | }; |
diff --git a/crates/ra_assists/src/handlers/raw_string.rs b/crates/ra_assists/src/handlers/raw_string.rs index 4c797178f..9ddd116e0 100644 --- a/crates/ra_assists/src/handlers/raw_string.rs +++ b/crates/ra_assists/src/handlers/raw_string.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::borrow::Cow; | 1 | use std::borrow::Cow; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use syntax::{ |
4 | ast::{self, HasQuotes, HasStringValue}, | 4 | ast::{self, HasQuotes, HasStringValue}, |
5 | AstToken, | 5 | AstToken, |
6 | SyntaxKind::{RAW_STRING, STRING}, | 6 | SyntaxKind::{RAW_STRING, STRING}, |
diff --git a/crates/ra_assists/src/handlers/remove_dbg.rs b/crates/ra_assists/src/handlers/remove_dbg.rs index 9430ce1b5..f3dcca534 100644 --- a/crates/ra_assists/src/handlers/remove_dbg.rs +++ b/crates/ra_assists/src/handlers/remove_dbg.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ | 1 | use syntax::{ |
2 | ast::{self, AstNode}, | 2 | ast::{self, AstNode}, |
3 | TextRange, TextSize, T, | 3 | TextRange, TextSize, T, |
4 | }; | 4 | }; |
diff --git a/crates/ra_assists/src/handlers/remove_mut.rs b/crates/ra_assists/src/handlers/remove_mut.rs index ef55c354e..44f41daa9 100644 --- a/crates/ra_assists/src/handlers/remove_mut.rs +++ b/crates/ra_assists/src/handlers/remove_mut.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{SyntaxKind, TextRange, T}; | 1 | use syntax::{SyntaxKind, TextRange, T}; |
2 | 2 | ||
3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
4 | 4 | ||
diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs index c9b743a06..013720dfc 100644 --- a/crates/ra_assists/src/handlers/reorder_fields.rs +++ b/crates/ra_assists/src/handlers/reorder_fields.rs | |||
@@ -3,7 +3,7 @@ use rustc_hash::FxHashMap; | |||
3 | 3 | ||
4 | use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct}; | 4 | use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct}; |
5 | use ra_ide_db::RootDatabase; | 5 | use ra_ide_db::RootDatabase; |
6 | use ra_syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode}; | 6 | use syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode}; |
7 | 7 | ||
8 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 8 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
9 | 9 | ||
diff --git a/crates/ra_assists/src/handlers/replace_if_let_with_match.rs b/crates/ra_assists/src/handlers/replace_if_let_with_match.rs index ecafb74a1..2442f049b 100644 --- a/crates/ra_assists/src/handlers/replace_if_let_with_match.rs +++ b/crates/ra_assists/src/handlers/replace_if_let_with_match.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ra_fmt::unwrap_trivial_block; | 1 | use ra_fmt::unwrap_trivial_block; |
2 | use ra_syntax::{ | 2 | use syntax::{ |
3 | ast::{ | 3 | ast::{ |
4 | self, | 4 | self, |
5 | edit::{AstNodeEdit, IndentLevel}, | 5 | edit::{AstNodeEdit, IndentLevel}, |
diff --git a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs index e4d436dec..ed6d0c29b 100644 --- a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs +++ b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::iter::once; | 1 | use std::iter::once; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use syntax::{ |
4 | ast::{ | 4 | ast::{ |
5 | self, | 5 | self, |
6 | edit::{AstNodeEdit, IndentLevel}, | 6 | edit::{AstNodeEdit, IndentLevel}, |
diff --git a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs index da0a860c5..011bf1106 100644 --- a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use hir; | 1 | use hir; |
2 | use ra_syntax::{algo::SyntaxRewriter, ast, match_ast, AstNode, SmolStr, SyntaxNode}; | 2 | use syntax::{algo::SyntaxRewriter, ast, match_ast, AstNode, SmolStr, SyntaxNode}; |
3 | 3 | ||
4 | use crate::{ | 4 | use crate::{ |
5 | utils::{find_insert_use_container, insert_use_statement}, | 5 | utils::{find_insert_use_container, insert_use_statement}, |
diff --git a/crates/ra_assists/src/handlers/replace_unwrap_with_match.rs b/crates/ra_assists/src/handlers/replace_unwrap_with_match.rs index d69f2c1b0..9705f11b7 100644 --- a/crates/ra_assists/src/handlers/replace_unwrap_with_match.rs +++ b/crates/ra_assists/src/handlers/replace_unwrap_with_match.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::iter; | 1 | use std::iter; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use syntax::{ |
4 | ast::{ | 4 | ast::{ |
5 | self, | 5 | self, |
6 | edit::{AstNodeEdit, IndentLevel}, | 6 | edit::{AstNodeEdit, IndentLevel}, |
diff --git a/crates/ra_assists/src/handlers/split_import.rs b/crates/ra_assists/src/handlers/split_import.rs index 4ca5c3ca1..15e67eaa1 100644 --- a/crates/ra_assists/src/handlers/split_import.rs +++ b/crates/ra_assists/src/handlers/split_import.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::iter::successors; | 1 | use std::iter::successors; |
2 | 2 | ||
3 | use ra_syntax::{ast, AstNode, T}; | 3 | use syntax::{ast, AstNode, T}; |
4 | 4 | ||
5 | use crate::{AssistContext, AssistId, AssistKind, Assists}; | 5 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
6 | 6 | ||
diff --git a/crates/ra_assists/src/handlers/unwrap_block.rs b/crates/ra_assists/src/handlers/unwrap_block.rs index 8b38695a9..2879090b8 100644 --- a/crates/ra_assists/src/handlers/unwrap_block.rs +++ b/crates/ra_assists/src/handlers/unwrap_block.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ra_fmt::unwrap_trivial_block; | 1 | use ra_fmt::unwrap_trivial_block; |
2 | use ra_syntax::{ | 2 | use syntax::{ |
3 | ast::{ | 3 | ast::{ |
4 | self, | 4 | self, |
5 | edit::{AstNodeEdit, IndentLevel}, | 5 | edit::{AstNodeEdit, IndentLevel}, |
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 890996a68..e2ef561fe 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -20,7 +20,7 @@ pub mod ast_transform; | |||
20 | use hir::Semantics; | 20 | use hir::Semantics; |
21 | use ra_db::FileRange; | 21 | use ra_db::FileRange; |
22 | use ra_ide_db::{source_change::SourceChange, RootDatabase}; | 22 | use ra_ide_db::{source_change::SourceChange, RootDatabase}; |
23 | use ra_syntax::TextRange; | 23 | use syntax::TextRange; |
24 | 24 | ||
25 | pub(crate) use crate::assist_context::{AssistContext, Assists}; | 25 | pub(crate) use crate::assist_context::{AssistContext, Assists}; |
26 | 26 | ||
diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs index e73836422..1ae7aaa09 100644 --- a/crates/ra_assists/src/tests.rs +++ b/crates/ra_assists/src/tests.rs | |||
@@ -3,7 +3,7 @@ mod generated; | |||
3 | use hir::Semantics; | 3 | use hir::Semantics; |
4 | use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt}; | 4 | use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt}; |
5 | use ra_ide_db::RootDatabase; | 5 | use ra_ide_db::RootDatabase; |
6 | use ra_syntax::TextRange; | 6 | use syntax::TextRange; |
7 | use test_utils::{assert_eq_text, extract_offset, extract_range}; | 7 | use test_utils::{assert_eq_text, extract_offset, extract_range}; |
8 | 8 | ||
9 | use crate::{handlers::Handler, Assist, AssistConfig, AssistContext, AssistKind, Assists}; | 9 | use crate::{handlers::Handler, Assist, AssistConfig, AssistContext, AssistKind, Assists}; |
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs index 0de6fdf3f..6d85661c4 100644 --- a/crates/ra_assists/src/utils.rs +++ b/crates/ra_assists/src/utils.rs | |||
@@ -5,13 +5,13 @@ use std::{iter, ops}; | |||
5 | 5 | ||
6 | use hir::{Adt, Crate, Enum, ScopeDef, Semantics, Trait, Type}; | 6 | use hir::{Adt, Crate, Enum, ScopeDef, Semantics, Trait, Type}; |
7 | use ra_ide_db::RootDatabase; | 7 | use ra_ide_db::RootDatabase; |
8 | use ra_syntax::{ | 8 | use rustc_hash::FxHashSet; |
9 | use syntax::{ | ||
9 | ast::{self, make, NameOwner}, | 10 | ast::{self, make, NameOwner}, |
10 | AstNode, | 11 | AstNode, |
11 | SyntaxKind::*, | 12 | SyntaxKind::*, |
12 | SyntaxNode, TextSize, T, | 13 | SyntaxNode, TextSize, T, |
13 | }; | 14 | }; |
14 | use rustc_hash::FxHashSet; | ||
15 | 15 | ||
16 | use crate::assist_config::SnippetCap; | 16 | use crate::assist_config::SnippetCap; |
17 | 17 | ||
diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index 13dbe1919..f89c288da 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | use either::Either; | 5 | use either::Either; |
6 | use hir::{self, ModPath}; | 6 | use hir::{self, ModPath}; |
7 | use ra_syntax::{ | 7 | use syntax::{ |
8 | ast::{self, NameOwner, VisibilityOwner}, | 8 | ast::{self, NameOwner, VisibilityOwner}, |
9 | AstNode, Direction, SmolStr, | 9 | AstNode, Direction, SmolStr, |
10 | SyntaxKind::{PATH, PATH_SEGMENT}, | 10 | SyntaxKind::{PATH, PATH_SEGMENT}, |