From 8300132ed0676496ec4adda49eb682ac24bdb5b9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 May 2020 23:50:29 +0200 Subject: More snippets --- crates/ra_assists/src/handlers/split_import.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_assists/src/handlers/split_import.rs') diff --git a/crates/ra_assists/src/handlers/split_import.rs b/crates/ra_assists/src/handlers/split_import.rs index b2757e50c..c7a874480 100644 --- a/crates/ra_assists/src/handlers/split_import.rs +++ b/crates/ra_assists/src/handlers/split_import.rs @@ -26,12 +26,10 @@ pub(crate) fn split_import(acc: &mut Assists, ctx: &AssistContext) -> Option<()> if new_tree == use_tree { return None; } - let cursor = ctx.offset(); let target = colon_colon.text_range(); acc.add(AssistId("split_import"), "Split import", target, |edit| { edit.replace_ast(use_tree, new_tree); - edit.set_cursor(cursor); }) } @@ -46,7 +44,7 @@ mod tests { check_assist( split_import, "use crate::<|>db::RootDatabase;", - "use crate::<|>{db::RootDatabase};", + "use crate::{db::RootDatabase};", ) } @@ -55,7 +53,7 @@ mod tests { check_assist( split_import, "use crate:<|>:db::{RootDatabase, FileSymbol}", - "use crate:<|>:{db::{RootDatabase, FileSymbol}}", + "use crate::{db::{RootDatabase, FileSymbol}}", ) } -- cgit v1.2.3