aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-03-02 23:26:53 +0000
committerKirill Bulatov <[email protected]>2021-03-08 21:59:20 +0000
commit33c83e72b9b48177a6171fd06a26676679963a4d (patch)
treeb787206319b2cf0050e4ce7c89ad4365b9a43c11 /crates/hir_def/src
parent4d4ac1d4fa0aba107a27d3fd2d209304dfe69b9f (diff)
Work towards better import labels
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r--crates/hir_def/src/import_map.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs
index 369bc3350..07ee7bdfd 100644
--- a/crates/hir_def/src/import_map.rs
+++ b/crates/hir_def/src/import_map.rs
@@ -1094,4 +1094,27 @@ mod tests {
1094 expect![[r#""#]], 1094 expect![[r#""#]],
1095 ); 1095 );
1096 } 1096 }
1097
1098 #[test]
1099 fn search_with_path() {
1100 check_search(
1101 r#"
1102//- /main.rs crate:main deps:dep
1103//- /dep.rs crate:dep
1104pub mod foo {
1105 pub mod bar {
1106 pub mod baz {
1107 pub trait Display {
1108 fn fmt();
1109 }
1110 }
1111 }
1112}"#,
1113 "main",
1114 Query::new("baz::fmt".to_string()).search_mode(SearchMode::Fuzzy),
1115 expect![[r#"
1116 dep::foo::bar::baz::Display::fmt (a)
1117 "#]],
1118 );
1119 }
1097} 1120}