From da74c66947ec847f2ca8e99d96cc7e36fd494c75 Mon Sep 17 00:00:00 2001 From: Lukas Tobias Wirth Date: Sun, 23 May 2021 19:33:28 +0200 Subject: Correctly resolve crate name in use paths when import shadows itself --- crates/ide/src/hover.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crates/ide') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 9de653739..04598cd06 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -3957,4 +3957,24 @@ mod string { "#]], ) } + + #[test] + fn function_doesnt_shadow_crate_in_use_tree() { + check( + r#" +//- /main.rs crate:main deps:foo +use foo$0::{foo}; + +//- /foo.rs crate:foo +pub fn foo() {} +"#, + expect![[r#" + *foo* + + ```rust + extern crate foo + ``` + "#]], + ) + } } -- cgit v1.2.3