From a3622eb629bf7acea933d956f8cee902ae357fca Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 8 Feb 2019 22:43:13 +0100 Subject: Add some assist ranges --- crates/ra_assists/src/split_import.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ra_assists/src/split_import.rs') diff --git a/crates/ra_assists/src/split_import.rs b/crates/ra_assists/src/split_import.rs index fb69cef9c..287c05830 100644 --- a/crates/ra_assists/src/split_import.rs +++ b/crates/ra_assists/src/split_import.rs @@ -24,6 +24,7 @@ pub(crate) fn split_import(ctx: AssistCtx) -> Option { }; ctx.build("split import", |edit| { + edit.target(colon_colon.range()); edit.insert(l_curly, "{"); edit.insert(r_curly, "}"); edit.set_cursor(l_curly + TextUnit::of_str("{")); -- cgit v1.2.3 From 3be98f2ac93b278828e76eb813bdd8033f647b12 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 9 Feb 2019 00:34:05 +0100 Subject: Add tests for action target ranges --- crates/ra_assists/src/split_import.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/ra_assists/src/split_import.rs') diff --git a/crates/ra_assists/src/split_import.rs b/crates/ra_assists/src/split_import.rs index 287c05830..051bc6fec 100644 --- a/crates/ra_assists/src/split_import.rs +++ b/crates/ra_assists/src/split_import.rs @@ -34,7 +34,7 @@ pub(crate) fn split_import(ctx: AssistCtx) -> Option { #[cfg(test)] mod tests { use super::*; - use crate::helpers::check_assist; + use crate::helpers::{check_assist, check_assist_target}; #[test] fn test_split_import() { @@ -53,4 +53,9 @@ mod tests { "use algo::{<|>visitor::{Visitor, visit}}", ) } + + #[test] + fn split_import_target() { + check_assist_target(split_import, "use algo::<|>visitor::{Visitor, visit}", "::"); + } } -- cgit v1.2.3