diff options
author | Lukas Wirth <[email protected]> | 2021-02-24 22:37:08 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-02-28 22:44:49 +0000 |
commit | ca7cd41a48251835ee107bd29f4f259b9aa93c43 (patch) | |
tree | e0cede3dff7921a3ed15429b97295d3a7427b739 /crates/ide | |
parent | aa38fa1c72673cb2470651025782fb0fcfad738c (diff) |
Fix lowering trailing self paths in UseTrees
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/hover.rs | 29 |
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 | ||
3505 | mod foo { | ||
3506 | /// But this should appear | ||
3507 | pub mod bar {} | ||
3508 | } | ||
3509 | use 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 | } |