aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src')
-rw-r--r--crates/hir/src/code_model.rs14
-rw-r--r--crates/hir/src/db.rs2
-rw-r--r--crates/hir/src/diagnostics.rs4
-rw-r--r--crates/hir/src/lib.rs5
4 files changed, 11 insertions, 14 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 30a5e4580..f06b5cd9f 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -110,15 +110,9 @@ impl Crate {
110 pub fn query_external_importables( 110 pub fn query_external_importables(
111 self, 111 self,
112 db: &dyn DefDatabase, 112 db: &dyn DefDatabase,
113 query: &str, 113 query: import_map::Query,
114 ) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> { 114 ) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
115 import_map::search_dependencies( 115 import_map::search_dependencies(db, self.into(), query).into_iter().map(|item| match item {
116 db,
117 self.into(),
118 import_map::Query::new(query).anchor_end().case_sensitive().limit(40),
119 )
120 .into_iter()
121 .map(|item| match item {
122 ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id.into()), 116 ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id.into()),
123 ItemInNs::Macros(mac_id) => Either::Right(mac_id.into()), 117 ItemInNs::Macros(mac_id) => Either::Right(mac_id.into()),
124 }) 118 })
@@ -1426,11 +1420,11 @@ impl Type {
1426 pub fn normalize_trait_assoc_type( 1420 pub fn normalize_trait_assoc_type(
1427 &self, 1421 &self,
1428 db: &dyn HirDatabase, 1422 db: &dyn HirDatabase,
1429 r#trait: Trait, 1423 trait_: Trait,
1430 args: &[Type], 1424 args: &[Type],
1431 alias: TypeAlias, 1425 alias: TypeAlias,
1432 ) -> Option<Type> { 1426 ) -> Option<Type> {
1433 let subst = Substs::build_for_def(db, r#trait.id) 1427 let subst = Substs::build_for_def(db, trait_.id)
1434 .push(self.ty.value.clone()) 1428 .push(self.ty.value.clone())
1435 .fill(args.iter().map(|t| t.ty.value.clone())) 1429 .fill(args.iter().map(|t| t.ty.value.clone()))
1436 .build(); 1430 .build();
diff --git a/crates/hir/src/db.rs b/crates/hir/src/db.rs
index 07333c453..8c767b249 100644
--- a/crates/hir/src/db.rs
+++ b/crates/hir/src/db.rs
@@ -11,7 +11,7 @@ pub use hir_def::db::{
11}; 11};
12pub use hir_expand::db::{ 12pub use hir_expand::db::{
13 AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery, 13 AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery,
14 MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery, 14 MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroExpansionQuery,
15}; 15};
16pub use hir_ty::db::*; 16pub use hir_ty::db::*;
17 17
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index c18c1c587..d9ad8db6f 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -1,6 +1,8 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2pub use hir_def::diagnostics::{InactiveCode, UnresolvedModule}; 2pub use hir_def::diagnostics::{InactiveCode, UnresolvedModule};
3pub use hir_expand::diagnostics::{Diagnostic, DiagnosticSink, DiagnosticSinkBuilder}; 3pub use hir_expand::diagnostics::{
4 Diagnostic, DiagnosticCode, DiagnosticSink, DiagnosticSinkBuilder,
5};
4pub use hir_ty::diagnostics::{ 6pub use hir_ty::diagnostics::{
5 IncorrectCase, MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr, 7 IncorrectCase, MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr,
6 NoSuchField, 8 NoSuchField,
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 0d184379f..93bdb4472 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -49,6 +49,7 @@ pub use hir_def::{
49 builtin_type::BuiltinType, 49 builtin_type::BuiltinType,
50 docs::Documentation, 50 docs::Documentation,
51 find_path::PrefixKind, 51 find_path::PrefixKind,
52 import_map,
52 item_scope::ItemInNs, 53 item_scope::ItemInNs,
53 nameres::ModuleSource, 54 nameres::ModuleSource,
54 path::{ModPath, PathKind}, 55 path::{ModPath, PathKind},
@@ -56,8 +57,8 @@ pub use hir_def::{
56 visibility::Visibility, 57 visibility::Visibility,
57}; 58};
58pub use hir_expand::{ 59pub use hir_expand::{
59 name::known, name::AsName, name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, 60 name::known, name::AsName, name::Name, ExpandResult, HirFileId, InFile, MacroCallId,
60 /* FIXME */ MacroDefId, MacroFile, Origin, 61 MacroCallLoc, /* FIXME */ MacroDefId, MacroFile, Origin,
61}; 62};
62pub use hir_ty::display::HirDisplay; 63pub use hir_ty::display::HirDisplay;
63 64