From 0057d1e10d1bc94557e94e551079be0c9c281d3f Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Sat, 29 Feb 2020 20:53:01 -0800 Subject: fix completion for super::super:: --- crates/ra_ide/src/completion/complete_dot.rs | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs index a6e0158b2..9145aa183 100644 --- a/crates/ra_ide/src/completion/complete_dot.rs +++ b/crates/ra_ide/src/completion/complete_dot.rs @@ -545,4 +545,43 @@ mod tests { "### ) } + + #[test] + fn test_super_super_completion() { + assert_debug_snapshot!( + do_ref_completion( + r" + mod a { + const A: usize = 0; + + mod b { + const B: usize = 0; + + mod c { + use super::super::<|> + } + } + } + ", + ), + @r###" + [ + CompletionItem { + label: "A", + source_range: [217; 217), + delete: [217; 217), + insert: "A", + kind: Const, + }, + CompletionItem { + label: "b", + source_range: [217; 217), + delete: [217; 217), + insert: "b", + kind: Module, + }, + ] + "### + ); + } } -- cgit v1.2.3