Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/fn_param.rs')
-rw-r--r--crates/ide-completion/src/tests/fn_param.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/fn_param.rs b/crates/ide-completion/src/tests/fn_param.rs
index 02cba6b646..d6d73da3f1 100644
--- a/crates/ide-completion/src/tests/fn_param.rs
+++ b/crates/ide-completion/src/tests/fn_param.rs
@@ -293,6 +293,60 @@ fn bar(bar$0) {}
}
#[test]
+fn not_shows_fully_equal_inside_pattern_params() {
+ check(
+ r#"
+fn foo(bar: u32) {}
+fn bar((a, bar$0)) {}
+"#,
+ expect![[r#"
+ kw mut
+ kw ref
+ "#]],
+ )
+}
+
+#[test]
+fn not_shows_locals_inside_pattern_params() {
+ check(
+ r#"
+fn outer() {
+ let foo = 3;
+ {
+ let bar = 3;
+ |($0)| {};
+ let baz = 3;
+ let qux = 3;
+ }
+ let fez = 3;
+}
+"#,
+ expect![[r#"
+ kw mut
+ kw ref
+ "#]],
+ );
+ check(
+ r#"
+fn outer() {
+ let foo = 3;
+ {
+ let bar = 3;
+ fn inner(($0)) {}
+ let baz = 3;
+ let qux = 3;
+ }
+ let fez = 3;
+}
+"#,
+ expect![[r#"
+ kw mut
+ kw ref
+ "#]],
+ );
+}
+
+#[test]
fn completes_for_params_with_attributes() {
check(
r#"