aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/completion/complete_unqualified_path.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-05 22:27:18 +0100
committerGitHub <[email protected]>2020-10-05 22:27:18 +0100
commit44587d1bfcc40839135451e620b6f80cbfd401e5 (patch)
treed6f838aa40d3e9347cc0c4d70e6e9eb4de9754ff /crates/ide/src/completion/complete_unqualified_path.rs
parentaa76ce36e1a1d4b6132842fd2c34b9790f2d8d5b (diff)
parent32864e3b499426aa6a49402f07570c09ec5fcde7 (diff)
Merge #6127
6127: Correctly complete items with leading underscore r=SomeoneToIgnore a=fmease Fixes #6091. Let me know if the test is placed into the right file or if it is even desired. Co-authored-by: León Orell Valerian Liehr <[email protected]>
Diffstat (limited to 'crates/ide/src/completion/complete_unqualified_path.rs')
-rw-r--r--crates/ide/src/completion/complete_unqualified_path.rs20
1 files changed, 20 insertions, 0 deletions
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() { <|> }
267 ); 267 );
268 } 268 }
269 269
270 /// Regression test for issue #6091.
271 #[test]
272 fn correctly_completes_module_items_prefixed_with_underscore() {
273 check_edit(
274 "_alpha",
275 r#"
276fn main() {
277 _<|>
278}
279fn _alpha() {}
280"#,
281 r#"
282fn main() {
283 _alpha()$0
284}
285fn _alpha() {}
286"#,
287 )
288 }
289
270 #[test] 290 #[test]
271 fn completes_extern_prelude() { 291 fn completes_extern_prelude() {
272 check( 292 check(