aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ssr
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ssr')
-rw-r--r--crates/ra_ssr/Cargo.toml2
-rw-r--r--crates/ra_ssr/src/replacing.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ssr/Cargo.toml b/crates/ra_ssr/Cargo.toml
index 84e4b171e..d0f2ae733 100644
--- a/crates/ra_ssr/Cargo.toml
+++ b/crates/ra_ssr/Cargo.toml
@@ -11,7 +11,7 @@ repository = "https://github.com/rust-analyzer/rust-analyzer"
11doctest = false 11doctest = false
12 12
13[dependencies] 13[dependencies]
14ra_text_edit = { path = "../ra_text_edit" } 14text_edit = { path = "../text_edit" }
15ra_syntax = { path = "../ra_syntax" } 15ra_syntax = { path = "../ra_syntax" }
16ra_db = { path = "../ra_db" } 16ra_db = { path = "../ra_db" }
17ra_ide_db = { path = "../ra_ide_db" } 17ra_ide_db = { path = "../ra_ide_db" }
diff --git a/crates/ra_ssr/src/replacing.rs b/crates/ra_ssr/src/replacing.rs
index 0943244ff..74f9e7db6 100644
--- a/crates/ra_ssr/src/replacing.rs
+++ b/crates/ra_ssr/src/replacing.rs
@@ -4,8 +4,8 @@ use crate::matching::Var;
4use crate::{resolving::ResolvedRule, Match, SsrMatches}; 4use crate::{resolving::ResolvedRule, Match, SsrMatches};
5use ra_syntax::ast::{self, AstToken}; 5use ra_syntax::ast::{self, AstToken};
6use ra_syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize}; 6use ra_syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize};
7use ra_text_edit::TextEdit;
8use rustc_hash::{FxHashMap, FxHashSet}; 7use rustc_hash::{FxHashMap, FxHashSet};
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
11/// template. Placeholders in the template will have been substituted with whatever they matched to 11/// template. Placeholders in the template will have been substituted with whatever they matched to
@@ -24,7 +24,7 @@ fn matches_to_edit_at_offset(
24 relative_start: TextSize, 24 relative_start: TextSize,
25 rules: &[ResolvedRule], 25 rules: &[ResolvedRule],
26) -> TextEdit { 26) -> TextEdit {
27 let mut edit_builder = ra_text_edit::TextEditBuilder::default(); 27 let mut edit_builder = TextEdit::builder();
28 for m in &matches.matches { 28 for m in &matches.matches {
29 edit_builder.replace( 29 edit_builder.replace(
30 m.range.range.checked_sub(relative_start).unwrap(), 30 m.range.range.checked_sub(relative_start).unwrap(),