diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-05 22:27:18 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-05 22:27:18 +0100 |
commit | 44587d1bfcc40839135451e620b6f80cbfd401e5 (patch) | |
tree | d6f838aa40d3e9347cc0c4d70e6e9eb4de9754ff /crates/ide/src/completion/complete_unqualified_path.rs | |
parent | aa76ce36e1a1d4b6132842fd2c34b9790f2d8d5b (diff) | |
parent | 32864e3b499426aa6a49402f07570c09ec5fcde7 (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.rs | 20 |
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#" | ||
276 | fn main() { | ||
277 | _<|> | ||
278 | } | ||
279 | fn _alpha() {} | ||
280 | "#, | ||
281 | r#" | ||
282 | fn main() { | ||
283 | _alpha()$0 | ||
284 | } | ||
285 | fn _alpha() {} | ||
286 | "#, | ||
287 | ) | ||
288 | } | ||
289 | |||
270 | #[test] | 290 | #[test] |
271 | fn completes_extern_prelude() { | 291 | fn completes_extern_prelude() { |
272 | check( | 292 | check( |