mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
fix: rename syntax_editor_add_generic_param
to add_generic_param
Signed-off-by: Tarek <tareknaser360@gmail.com>
This commit is contained in:
parent
b7e613c0dc
commit
8954a7f9e9
@ -50,7 +50,7 @@ pub(crate) fn introduce_named_generic(acc: &mut Assists, ctx: &AssistContext<'_>
|
|||||||
let new_ty = make.ty(&type_param_name);
|
let new_ty = make.ty(&type_param_name);
|
||||||
|
|
||||||
editor.replace(impl_trait_type.syntax(), new_ty.syntax());
|
editor.replace(impl_trait_type.syntax(), new_ty.syntax());
|
||||||
editor.syntax_editor_add_generic_param(fn_, type_param.clone().into());
|
editor.add_generic_param(&fn_, type_param.clone().into());
|
||||||
|
|
||||||
if let Some(cap) = ctx.config.snippet_cap {
|
if let Some(cap) = ctx.config.snippet_cap {
|
||||||
editor.add_annotation(type_param.syntax(), builder.make_tabstop_before(cap));
|
editor.add_annotation(type_param.syntax(), builder.make_tabstop_before(cap));
|
||||||
|
@ -7,7 +7,7 @@ use crate::{
|
|||||||
|
|
||||||
impl SyntaxEditor {
|
impl SyntaxEditor {
|
||||||
/// Adds a new generic param to the function using `SyntaxEditor`
|
/// Adds a new generic param to the function using `SyntaxEditor`
|
||||||
pub fn syntax_editor_add_generic_param(&mut self, function: Fn, new_param: GenericParam) {
|
pub fn add_generic_param(&mut self, function: &Fn, new_param: GenericParam) {
|
||||||
match function.generic_param_list() {
|
match function.generic_param_list() {
|
||||||
Some(generic_param_list) => match generic_param_list.generic_params().last() {
|
Some(generic_param_list) => match generic_param_list.generic_params().last() {
|
||||||
Some(last_param) => {
|
Some(last_param) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user