From 33c83e72b9b48177a6171fd06a26676679963a4d Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 3 Mar 2021 01:26:53 +0200 Subject: Work towards better import labels --- crates/hir_def/src/import_map.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates/hir_def/src/import_map.rs') 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 { expect![[r#""#]], ); } + + #[test] + fn search_with_path() { + check_search( + r#" +//- /main.rs crate:main deps:dep +//- /dep.rs crate:dep +pub mod foo { + pub mod bar { + pub mod baz { + pub trait Display { + fn fmt(); + } + } + } +}"#, + "main", + Query::new("baz::fmt".to_string()).search_mode(SearchMode::Fuzzy), + expect![[r#" + dep::foo::bar::baz::Display::fmt (a) + "#]], + ); + } } -- cgit v1.2.3