Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/dot.rs')
-rw-r--r--crates/ide-completion/src/completions/dot.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ide-completion/src/completions/dot.rs b/crates/ide-completion/src/completions/dot.rs
index 12591449cd..430dea2225 100644
--- a/crates/ide-completion/src/completions/dot.rs
+++ b/crates/ide-completion/src/completions/dot.rs
@@ -1206,4 +1206,17 @@ impl<B: Bar, F: core::ops::Deref<Target = B>> Foo<F> {
"#]],
);
}
+
+ #[test]
+ fn test_struct_function_field_completion() {
+ check(
+ r#"
+struct S { field: fn() }
+fn foo() { S { field: || {} }.fi$0() }
+"#,
+ expect![[r#"
+ fd field fn()
+ "#]],
+ );
+ }
}