diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-01 13:36:44 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-01 13:36:44 +0000 |
commit | ea67e2346e64a1a14206e6d0f163c6c2e19d0afb (patch) | |
tree | 80a4f5c9b04008df8502ed75b230661fb9041742 /crates/ra_ide/src/completion | |
parent | 6db2da4993d3956fc7c8ebf152963a132611426a (diff) | |
parent | 0057d1e10d1bc94557e94e551079be0c9c281d3f (diff) |
Merge #3384
3384: fix #2377 super::super::* r=flodiebold a=JoshMcguigan
Thanks @matklad for the detailed explanation on #2377. I believe this fixes it.
One thing I'm not sure about is you said the fix would involve changing `crates/ra_hir_def/src/path/lower/lower.rs`, but I only changed `crates/ra_hir_def/src/path/lower/lower_use.rs`. I'm not sure what kind of test code I'd have to write to expose the issue in `lower.rs`, but I'd be happy to add it if you are able to provide additional guidance.
closes #2377
Co-authored-by: Josh Mcguigan <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/complete_dot.rs | 39 |
1 files changed, 39 insertions, 0 deletions
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 { | |||
545 | "### | 545 | "### |
546 | ) | 546 | ) |
547 | } | 547 | } |
548 | |||
549 | #[test] | ||
550 | fn test_super_super_completion() { | ||
551 | assert_debug_snapshot!( | ||
552 | do_ref_completion( | ||
553 | r" | ||
554 | mod a { | ||
555 | const A: usize = 0; | ||
556 | |||
557 | mod b { | ||
558 | const B: usize = 0; | ||
559 | |||
560 | mod c { | ||
561 | use super::super::<|> | ||
562 | } | ||
563 | } | ||
564 | } | ||
565 | ", | ||
566 | ), | ||
567 | @r###" | ||
568 | [ | ||
569 | CompletionItem { | ||
570 | label: "A", | ||
571 | source_range: [217; 217), | ||
572 | delete: [217; 217), | ||
573 | insert: "A", | ||
574 | kind: Const, | ||
575 | }, | ||
576 | CompletionItem { | ||
577 | label: "b", | ||
578 | source_range: [217; 217), | ||
579 | delete: [217; 217), | ||
580 | insert: "b", | ||
581 | kind: Module, | ||
582 | }, | ||
583 | ] | ||
584 | "### | ||
585 | ); | ||
586 | } | ||
548 | } | 587 | } |