From 7510048ec0a5d5e7136e3ea258954eb244d15baf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:58:56 +0200 Subject: Cleanup TextEdit API --- crates/ra_ssr/src/replacing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ssr') diff --git a/crates/ra_ssr/src/replacing.rs b/crates/ra_ssr/src/replacing.rs index 0943244ff..36ced3842 100644 --- a/crates/ra_ssr/src/replacing.rs +++ b/crates/ra_ssr/src/replacing.rs @@ -24,7 +24,7 @@ fn matches_to_edit_at_offset( relative_start: TextSize, rules: &[ResolvedRule], ) -> TextEdit { - let mut edit_builder = ra_text_edit::TextEditBuilder::default(); + let mut edit_builder = TextEdit::builder(); for m in &matches.matches { edit_builder.replace( m.range.range.checked_sub(relative_start).unwrap(), -- cgit v1.2.3 From 6dafc13f5f776980cd2560fb79d3d4790811c96d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 17:03:06 +0200 Subject: Rename ra_text_edit -> text_edit --- crates/ra_ssr/Cargo.toml | 2 +- crates/ra_ssr/src/replacing.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ssr') 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" doctest = false [dependencies] -ra_text_edit = { path = "../ra_text_edit" } +text_edit = { path = "../text_edit" } ra_syntax = { path = "../ra_syntax" } ra_db = { path = "../ra_db" } ra_ide_db = { path = "../ra_ide_db" } diff --git a/crates/ra_ssr/src/replacing.rs b/crates/ra_ssr/src/replacing.rs index 36ced3842..74f9e7db6 100644 --- a/crates/ra_ssr/src/replacing.rs +++ b/crates/ra_ssr/src/replacing.rs @@ -4,8 +4,8 @@ use crate::matching::Var; use crate::{resolving::ResolvedRule, Match, SsrMatches}; use ra_syntax::ast::{self, AstToken}; use ra_syntax::{SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize}; -use ra_text_edit::TextEdit; use rustc_hash::{FxHashMap, FxHashSet}; +use text_edit::TextEdit; /// Returns a text edit that will replace each match in `matches` with its corresponding replacement /// template. Placeholders in the template will have been substituted with whatever they matched to -- cgit v1.2.3