aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ssr/src/replacing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ssr/src/replacing.rs')
-rw-r--r--crates/ra_ssr/src/replacing.rs8
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
3use crate::matching::Var; 3use crate::matching::Var;
4use crate::{resolving::ResolvedRule, Match, SsrMatches}; 4use crate::{resolving::ResolvedRule, Match, SsrMatches};
5use ra_syntax::ast::{self, AstToken};
6use ra_syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize};
7use rustc_hash::{FxHashMap, FxHashSet}; 5use rustc_hash::{FxHashMap, FxHashSet};
6use syntax::ast::{self, AstToken};
7use syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize};
8use text_edit::TextEdit; 8use 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
182fn parse_as_kind(code: &str, kind: SyntaxKind) -> Option<SyntaxNode> { 182fn 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());