diff --git a/crates/ide_assists/src/handlers/add_turbo_fish.rs b/crates/ide_assists/src/handlers/add_turbo_fish.rs index 95182d6edef..12d9a9de6d4 100644 --- a/crates/ide_assists/src/handlers/add_turbo_fish.rs +++ b/crates/ide_assists/src/handlers/add_turbo_fish.rs @@ -80,7 +80,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<( let number_of_arguments = generics .iter() .filter(|param| match param { - hir::GenericParam::TypeParam(_) => true, + hir::GenericParam::TypeParam(_) | hir::GenericParam::ConstParam(_) => true, _ => false, }) .count(); @@ -361,6 +361,25 @@ fn make<'a, T, A>(t: T, a: A) {} fn main() { make::<${0:_,_}>(5, 2); } +"#, + ); + } + + #[test] + fn add_turbo_fish_function_const_parameter() { + check_assist( + add_turbo_fish, + r#" +fn make(t: T) {} +fn main() { + make$0(3); +} +"#, + r#" +fn make(t: T) {} +fn main() { + make::<${0:_,_}>(3); +} "#, ); }