aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-11-17 13:00:52 +0000
committerAleksey Kladov <[email protected]>2020-11-17 13:33:30 +0000
commit8dd0b7d2b59cffda0aa788c5d3016fe75d31a2ff (patch)
tree10327ac3462b268b51edfa2d3169444ddda50e8b
parentd4c970d1f21f014eddb550a2c33cacbf9546889d (diff)
Assist target should point at *existing* code
-rw-r--r--crates/assists/src/handlers/unwrap_block.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/assists/src/handlers/unwrap_block.rs b/crates/assists/src/handlers/unwrap_block.rs
index 36ef871b9..a82399aa8 100644
--- a/crates/assists/src/handlers/unwrap_block.rs
+++ b/crates/assists/src/handlers/unwrap_block.rs
@@ -83,8 +83,8 @@ pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
83 _ => return None, 83 _ => return None,
84 }; 84 };
85 85
86 let target = block.syntax().text_range();
86 let unwrapped = unwrap_trivial_block(block); 87 let unwrapped = unwrap_trivial_block(block);
87 let target = unwrapped.syntax().text_range();
88 acc.add(assist_id, assist_label, target, |builder| { 88 acc.add(assist_id, assist_label, target, |builder| {
89 builder.replace( 89 builder.replace(
90 parent.syntax().text_range(), 90 parent.syntax().text_range(),