Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/special.rs')
-rw-r--r--crates/ide-completion/src/tests/special.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/special.rs b/crates/ide-completion/src/tests/special.rs
index 84ddff8f61..59a0c144c8 100644
--- a/crates/ide-completion/src/tests/special.rs
+++ b/crates/ide-completion/src/tests/special.rs
@@ -1492,6 +1492,10 @@ fn foo(_: a_$0) { }
expect![[r#"
bt u32 u32
kw crate::
+ kw dyn
+ kw fn
+ kw for
+ kw impl
kw self::
"#]],
);
@@ -1506,6 +1510,39 @@ fn foo<T>() {
tp T
bt u32 u32
kw crate::
+ kw dyn
+ kw fn
+ kw for
+ kw impl
+ kw self::
+ "#]],
+ );
+}
+
+#[test]
+fn fn_generic_params_const_param_snippet() {
+ check_edit("const", "fn foo<c$0>() {}", "fn foo<const $1: $0>() {}");
+ check_edit("const", "fn foo<T, c$0>() {}", "fn foo<T, const $1: $0>() {}");
+ check(
+ r#"
+fn foo<T: $0>() {}
+"#,
+ expect![[r#"
+ kw crate::
+ kw self::
+ "#]],
+ );
+ check(
+ r#"
+fn foo<const N: $0>() {}
+"#,
+ expect![[r#"
+ bt u32 u32
+ kw crate::
+ kw dyn
+ kw fn
+ kw for
+ kw impl
kw self::
"#]],
);