mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Move target to AssistLabel
Target is used for assists sorting, so we need it before we compute the action.
This commit is contained in:
parent
ede8906844
commit
233f01c9ba
36 changed files with 288 additions and 252 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue