aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src
diff options
context:
space:
mode:
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}