From 45e343a0ef6f4caf078811d0664907610f085d54 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 May 2020 10:20:21 +0200 Subject: Minor --- crates/ra_assists/src/handlers/auto_import.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/ra_assists/src/handlers/auto_import.rs') diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs index 78d23150d..f6d25579e 100644 --- a/crates/ra_assists/src/handlers/auto_import.rs +++ b/crates/ra_assists/src/handlers/auto_import.rs @@ -50,7 +50,12 @@ pub(crate) fn auto_import(acc: &mut Assists, ctx: &AssistContext) -> Option<()> format!("Import `{}`", &import), range, |builder| { - insert_use_statement(&auto_import_assets.syntax_under_caret, &import, ctx, builder); + insert_use_statement( + &auto_import_assets.syntax_under_caret, + &import, + ctx, + builder.text_edit_builder(), + ); }, ); } -- cgit v1.2.3 From 65fa5864105280267e6ccdaa61957cd9953e444e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 May 2020 22:55:37 +0200 Subject: Relax cursor position tests in assists Those will be replaced with snippets anyway --- crates/ra_assists/src/handlers/auto_import.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ra_assists/src/handlers/auto_import.rs') diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs index f6d25579e..edf96d50e 100644 --- a/crates/ra_assists/src/handlers/auto_import.rs +++ b/crates/ra_assists/src/handlers/auto_import.rs @@ -298,7 +298,7 @@ mod tests { } ", r" - <|>use PubMod::PubStruct; + use PubMod::PubStruct; PubStruct @@ -329,7 +329,7 @@ mod tests { macro_rules! foo { ($i:ident) => { fn foo(a: $i) {} } } - foo!(Pub<|>Struct); + foo!(PubStruct); pub mod PubMod { pub struct PubStruct; @@ -360,7 +360,7 @@ mod tests { use PubMod::{PubStruct2, PubStruct1}; struct Test { - test: Pub<|>Struct2, + test: PubStruct2, } pub mod PubMod { @@ -393,7 +393,7 @@ mod tests { r" use PubMod3::PubStruct; - PubSt<|>ruct + PubStruct pub mod PubMod1 { pub struct PubStruct; @@ -474,7 +474,7 @@ mod tests { r" use PubMod::test_function; - test_function<|> + test_function pub mod PubMod { pub fn test_function() {}; @@ -501,7 +501,7 @@ mod tests { r"use crate_with_macro::foo; fn main() { - foo<|> + foo } ", ); @@ -587,7 +587,7 @@ fn main() { } fn main() { - TestStruct::test_function<|> + TestStruct::test_function } ", ); @@ -620,7 +620,7 @@ fn main() { } fn main() { - TestStruct::TEST_CONST<|> + TestStruct::TEST_CONST } ", ); @@ -659,7 +659,7 @@ fn main() { } fn main() { - test_mod::TestStruct::test_function<|> + test_mod::TestStruct::test_function } ", ); @@ -730,7 +730,7 @@ fn main() { } fn main() { - test_mod::TestStruct::TEST_CONST<|> + test_mod::TestStruct::TEST_CONST } ", ); @@ -803,7 +803,7 @@ fn main() { fn main() { let test_struct = test_mod::TestStruct {}; - test_struct.test_meth<|>od() + test_struct.test_method() } ", ); -- cgit v1.2.3