mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Support generic function in generate_function assist
This commit is contained in:
parent
32955c30cd
commit
3edde6fcc1
5 changed files with 888 additions and 45 deletions
|
|
@ -109,7 +109,7 @@ pub(crate) fn generate_delegate_methods(acc: &mut Assists, ctx: &AssistContext<'
|
|||
let tail_expr_finished =
|
||||
if is_async { make::expr_await(tail_expr) } else { tail_expr };
|
||||
let body = make::block_expr([], Some(tail_expr_finished));
|
||||
let f = make::fn_(vis, name, type_params, params, body, ret_type, is_async)
|
||||
let f = make::fn_(vis, name, type_params, None, params, body, ret_type, is_async)
|
||||
.indent(ast::edit::IndentLevel(1))
|
||||
.clone_for_update();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue