Assist target should point at *existing* code

This commit is contained in:
Aleksey Kladov 2020-11-17 14:00:52 +01:00
parent d4c970d1f2
commit 8dd0b7d2b5

View file

@ -83,8 +83,8 @@ pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
_ => return None,
};
let target = block.syntax().text_range();
let unwrapped = unwrap_trivial_block(block);
let target = unwrapped.syntax().text_range();
acc.add(assist_id, assist_label, target, |builder| {
builder.replace(
parent.syntax().text_range(),