From 32864e3b499426aa6a49402f07570c09ec5fcde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Orell=20Valerian=20Liehr?= Date: Sat, 3 Oct 2020 03:00:09 +0200 Subject: Correctly complete items with leading underscore --- .../ide/src/completion/complete_unqualified_path.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crates/ide/src/completion/complete_unqualified_path.rs') diff --git a/crates/ide/src/completion/complete_unqualified_path.rs b/crates/ide/src/completion/complete_unqualified_path.rs index 2010d9a2f..8b6757195 100644 --- a/crates/ide/src/completion/complete_unqualified_path.rs +++ b/crates/ide/src/completion/complete_unqualified_path.rs @@ -267,6 +267,26 @@ fn quux() { <|> } ); } + /// Regression test for issue #6091. + #[test] + fn correctly_completes_module_items_prefixed_with_underscore() { + check_edit( + "_alpha", + r#" +fn main() { + _<|> +} +fn _alpha() {} +"#, + r#" +fn main() { + _alpha()$0 +} +fn _alpha() {} +"#, + ) + } + #[test] fn completes_extern_prelude() { check( -- cgit v1.2.3