diff options
Diffstat (limited to 'crates/ra_ssr/src/replacing.rs')
-rw-r--r-- | crates/ra_ssr/src/replacing.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ssr/src/replacing.rs b/crates/ra_ssr/src/replacing.rs index 74f9e7db6..8f8fe6149 100644 --- a/crates/ra_ssr/src/replacing.rs +++ b/crates/ra_ssr/src/replacing.rs | |||
@@ -2,9 +2,9 @@ | |||
2 | 2 | ||
3 | use crate::matching::Var; | 3 | use crate::matching::Var; |
4 | use crate::{resolving::ResolvedRule, Match, SsrMatches}; | 4 | use crate::{resolving::ResolvedRule, Match, SsrMatches}; |
5 | use ra_syntax::ast::{self, AstToken}; | ||
6 | use ra_syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize}; | ||
7 | use rustc_hash::{FxHashMap, FxHashSet}; | 5 | use rustc_hash::{FxHashMap, FxHashSet}; |
6 | use syntax::ast::{self, AstToken}; | ||
7 | use syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize}; | ||
8 | use text_edit::TextEdit; | 8 | use text_edit::TextEdit; |
9 | 9 | ||
10 | /// Returns a text edit that will replace each match in `matches` with its corresponding replacement | 10 | /// Returns a text edit that will replace each match in `matches` with its corresponding replacement |
@@ -92,7 +92,7 @@ impl ReplacementRenderer<'_> { | |||
92 | } | 92 | } |
93 | 93 | ||
94 | fn render_node(&mut self, node: &SyntaxNode) { | 94 | fn render_node(&mut self, node: &SyntaxNode) { |
95 | use ra_syntax::ast::AstNode; | 95 | use syntax::ast::AstNode; |
96 | if let Some(mod_path) = self.match_info.rendered_template_paths.get(&node) { | 96 | if let Some(mod_path) = self.match_info.rendered_template_paths.get(&node) { |
97 | self.out.push_str(&mod_path.to_string()); | 97 | self.out.push_str(&mod_path.to_string()); |
98 | // Emit everything except for the segment's name-ref, since we already effectively | 98 | // Emit everything except for the segment's name-ref, since we already effectively |
@@ -180,7 +180,7 @@ impl ReplacementRenderer<'_> { | |||
180 | } | 180 | } |
181 | 181 | ||
182 | fn parse_as_kind(code: &str, kind: SyntaxKind) -> Option<SyntaxNode> { | 182 | fn parse_as_kind(code: &str, kind: SyntaxKind) -> Option<SyntaxNode> { |
183 | use ra_syntax::ast::AstNode; | 183 | use syntax::ast::AstNode; |
184 | if ast::Expr::can_cast(kind) { | 184 | if ast::Expr::can_cast(kind) { |
185 | if let Ok(expr) = ast::Expr::parse(code) { | 185 | if let Ok(expr) = ast::Expr::parse(code) { |
186 | return Some(expr.syntax().clone()); | 186 | return Some(expr.syntax().clone()); |