Move target to AssistLabel

Target is used for assists sorting, so we need it before we compute
the action.
This commit is contained in:
Aleksey Kladov 2020-05-06 12:51:28 +02:00
parent ede8906844
commit 233f01c9ba
36 changed files with 288 additions and 252 deletions

View file

@ -48,9 +48,8 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option<Assist> {
let label =
format!("Add custom impl '{}' for '{}'", trait_token.text().as_str(), annotated_name);
ctx.add_assist(AssistId("add_custom_impl"), label, |edit| {
edit.target(attr.syntax().text_range());
let target = attr.syntax().text_range();
ctx.add_assist(AssistId("add_custom_impl"), label, target, |edit| {
let new_attr_input = input
.syntax()
.descendants_with_tokens()