From ca7cd41a48251835ee107bd29f4f259b9aa93c43 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 24 Feb 2021 23:37:08 +0100 Subject: Fix lowering trailing self paths in UseTrees --- crates/ide/src/hover.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/ide/src') 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; "#]], ); } + + #[test] + fn hover_self_in_use() { + check( + r#" +//! This should not appear +mod foo { + /// But this should appear + pub mod bar {} +} +use foo::bar::{self$0}; +"#, + expect![[r#" + *self* + + ```rust + test::foo + ``` + + ```rust + pub mod bar + ``` + + --- + + But this should appear + "#]], + ); + } } -- cgit v1.2.3