aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-01 14:50:58 +0000
committerGitHub <[email protected]>2021-03-01 14:50:58 +0000
commitf3139d46b073eebc48ec347c899c05e286e6de0e (patch)
tree812483d413bffcfc3839df7bd1b1453e947d781b /crates/ide/src/hover.rs
parent4a9eec44787a0f2b35467ea98dd6f596671907f9 (diff)
parentca7cd41a48251835ee107bd29f4f259b9aa93c43 (diff)
Merge #7778
7778: Fix lowering trailing self paths in UseTrees r=Veykril a=Veykril Noticed that hovering over `self` in a use tree like `use foo::bar::{self}` showing documentation and such for the current module instead of `bar`. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 9a605b09d..20b799490 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -3496,4 +3496,33 @@ mod foo$0;
3496 "#]], 3496 "#]],
3497 ); 3497 );
3498 } 3498 }
3499
3500 #[test]
3501 fn hover_self_in_use() {
3502 check(
3503 r#"
3504//! This should not appear
3505mod foo {
3506 /// But this should appear
3507 pub mod bar {}
3508}
3509use foo::bar::{self$0};
3510"#,
3511 expect![[r#"
3512 *self*
3513
3514 ```rust
3515 test::foo
3516 ```
3517
3518 ```rust
3519 pub mod bar
3520 ```
3521
3522 ---
3523
3524 But this should appear
3525 "#]],
3526 );
3527 }
3499} 3528}