From 7208498d54b9f3d386b58f901c911a35170057ce Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Tue, 10 Mar 2020 19:58:17 -0700 Subject: fix issue 3444 --- crates/ra_ide/src/completion/complete_path.rs | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_path.rs index d588ee364..648c1d39b 100644 --- a/crates/ra_ide/src/completion/complete_path.rs +++ b/crates/ra_ide/src/completion/complete_path.rs @@ -967,4 +967,43 @@ mod tests { ] "###); } + + #[test] + fn function_mod_share_name() { + assert_debug_snapshot!( + do_reference_completion( + r" + fn foo() { + self::m::<|> + } + + mod m { + pub mod z {} + pub fn z() {} + } + ", + ), + @r###" + [ + CompletionItem { + label: "z", + source_range: [57; 57), + delete: [57; 57), + insert: "z", + kind: Module, + }, + CompletionItem { + label: "z()", + source_range: [57; 57), + delete: [57; 57), + insert: "z()$0", + kind: Function, + lookup: "z", + detail: "pub fn z()", + }, + ] + "### + ); + } + } -- cgit v1.2.3