Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/ide_assists/src/handlers/add_turbo_fish.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crates/ide_assists/src/handlers/add_turbo_fish.rs b/crates/ide_assists/src/handlers/add_turbo_fish.rs index 95182d6ede..12d9a9de6d 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(); @@ -364,4 +364,23 @@ fn main() { "#, ); } + + #[test] + fn add_turbo_fish_function_const_parameter() { + check_assist( + add_turbo_fish, + r#" +fn make<T, const N: usize>(t: T) {} +fn main() { + make$0(3); +} +"#, + r#" +fn make<T, const N: usize>(t: T) {} +fn main() { + make::<${0:_,_}>(3); +} +"#, + ); + } } |