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.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/special.rs b/crates/ide-completion/src/tests/special.rs
index 148203107c..59a0c144c8 100644
--- a/crates/ide-completion/src/tests/special.rs
+++ b/crates/ide-completion/src/tests/special.rs
@@ -677,6 +677,7 @@ fn bar() -> Bar {
expect![[r#"
fn foo() (as Foo) fn() -> Self
ex Bar
+ ex Bar::foo()
ex bar()
"#]],
);
@@ -706,6 +707,7 @@ fn bar() -> Bar {
fn bar() fn()
fn foo() (as Foo) fn() -> Self
ex Bar
+ ex Bar::foo()
ex bar()
"#]],
);
@@ -734,6 +736,7 @@ fn bar() -> Bar {
expect![[r#"
fn foo() (as Foo) fn() -> Self
ex Bar
+ ex Bar::foo()
ex bar()
"#]],
);
@@ -1489,6 +1492,10 @@ fn foo(_: a_$0) { }
expect![[r#"
bt u32 u32
kw crate::
+ kw dyn
+ kw fn
+ kw for
+ kw impl
kw self::
"#]],
);
@@ -1503,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::
"#]],
);