aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorLukas Tobias Wirth <[email protected]>2021-05-23 18:33:28 +0100
committerLukas Tobias Wirth <[email protected]>2021-05-23 18:37:01 +0100
commitda74c66947ec847f2ca8e99d96cc7e36fd494c75 (patch)
tree0f9f18647a70d38fc1c02761de8f4d9f16fb3283 /crates/ide/src
parentf04daf693aec9f3ffbd98bd368b79646246d506b (diff)
Correctly resolve crate name in use paths when import shadows itself
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/hover.rs20
1 files changed, 20 insertions, 0 deletions
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 {
3957 "#]], 3957 "#]],
3958 ) 3958 )
3959 } 3959 }
3960
3961 #[test]
3962 fn function_doesnt_shadow_crate_in_use_tree() {
3963 check(
3964 r#"
3965//- /main.rs crate:main deps:foo
3966use foo$0::{foo};
3967
3968//- /foo.rs crate:foo
3969pub fn foo() {}
3970"#,
3971 expect![[r#"
3972 *foo*
3973
3974 ```rust
3975 extern crate foo
3976 ```
3977 "#]],
3978 )
3979 }
3960} 3980}