diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 17 | ||||
-rw-r--r-- | crates/ra_hir/src/lib.rs | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 500b34c17..eaacf8c9e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -119,7 +119,7 @@ impl_froms!( | |||
119 | BuiltinType | 119 | BuiltinType |
120 | ); | 120 | ); |
121 | 121 | ||
122 | pub use hir_def::{attr::Attrs, visibility::Visibility, AssocItemId}; | 122 | pub use hir_def::{attr::Attrs, item_scope::ItemInNs, visibility::Visibility, AssocItemId}; |
123 | use rustc_hash::FxHashSet; | 123 | use rustc_hash::FxHashSet; |
124 | 124 | ||
125 | impl Module { | 125 | impl Module { |
@@ -238,11 +238,16 @@ impl Module { | |||
238 | item: ModuleDef, | 238 | item: ModuleDef, |
239 | ) -> Option<hir_def::path::ModPath> { | 239 | ) -> Option<hir_def::path::ModPath> { |
240 | // FIXME expose namespace choice | 240 | // FIXME expose namespace choice |
241 | hir_def::find_path::find_path( | 241 | hir_def::find_path::find_path(db, determine_item_namespace(item), self.into()) |
242 | db, | 242 | } |
243 | hir_def::item_scope::ItemInNs::Types(item.into()), | 243 | } |
244 | self.into(), | 244 | |
245 | ) | 245 | fn determine_item_namespace(module_def: ModuleDef) -> ItemInNs { |
246 | match module_def { | ||
247 | ModuleDef::Static(_) | ModuleDef::Const(_) | ModuleDef::Function(_) => { | ||
248 | ItemInNs::Values(module_def.into()) | ||
249 | } | ||
250 | _ => ItemInNs::Types(module_def.into()), | ||
246 | } | 251 | } |
247 | } | 252 | } |
248 | 253 | ||
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 9e2673d13..ea06a4a58 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -59,6 +59,7 @@ pub use hir_def::{ | |||
59 | ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. | 59 | ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. |
60 | }; | 60 | }; |
61 | pub use hir_expand::{ | 61 | pub use hir_expand::{ |
62 | name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, | 62 | name::{name, Name}, |
63 | HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, | ||
63 | }; | 64 | }; |
64 | pub use hir_ty::{display::HirDisplay, CallableDef}; | 65 | pub use hir_ty::{display::HirDisplay, CallableDef}; |