mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
fix: update introduce_named_generic
to use type_param
directly
Signed-off-by: Tarek <tareknaser360@gmail.com>
This commit is contained in:
parent
9157761f5d
commit
b7e613c0dc
1 changed files with 2 additions and 3 deletions
|
@ -50,11 +50,10 @@ pub(crate) fn introduce_named_generic(acc: &mut Assists, ctx: &AssistContext<'_>
|
|||
let new_ty = make.ty(&type_param_name);
|
||||
|
||||
editor.replace(impl_trait_type.syntax(), new_ty.syntax());
|
||||
let generic_param = syntax::ast::GenericParam::from(type_param);
|
||||
editor.syntax_editor_add_generic_param(fn_, generic_param.clone());
|
||||
editor.syntax_editor_add_generic_param(fn_, type_param.clone().into());
|
||||
|
||||
if let Some(cap) = ctx.config.snippet_cap {
|
||||
editor.add_annotation(generic_param.syntax(), builder.make_tabstop_before(cap));
|
||||
editor.add_annotation(type_param.syntax(), builder.make_tabstop_before(cap));
|
||||
}
|
||||
|
||||
editor.add_mappings(make.finish_with_mappings());
|
||||
|
|
Loading…
Reference in a new issue