diff options
Diffstat (limited to 'crates/ra_hir/src/nameres.rs')
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index 72791ed49..1d163edf7 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -21,7 +21,6 @@ use crate::nameres::lower::*; | |||
21 | use std::sync::Arc; | 21 | use std::sync::Arc; |
22 | 22 | ||
23 | use rustc_hash::{FxHashMap, FxHashSet}; | 23 | use rustc_hash::{FxHashMap, FxHashSet}; |
24 | use ra_syntax::SyntaxKind::*; | ||
25 | use ra_db::SourceRootId; | 24 | use ra_db::SourceRootId; |
26 | 25 | ||
27 | use crate::{ | 26 | use crate::{ |
@@ -235,27 +234,12 @@ where | |||
235 | } | 234 | } |
236 | } | 235 | } |
237 | // Populate explicitly declared items, except modules | 236 | // Populate explicitly declared items, except modules |
238 | for item in input.items.iter() { | 237 | for (name, &def_id) in input.declarations.iter() { |
239 | if item.kind == MODULE { | ||
240 | continue; | ||
241 | } | ||
242 | // depending on the item kind, the location can define something in | ||
243 | // the values namespace, the types namespace, or both | ||
244 | let kind = DefKind::for_syntax_kind(item.kind); | ||
245 | let def_id = kind.map(|k| { | ||
246 | let def_loc = DefLoc { | ||
247 | kind: k, | ||
248 | source_root_id: self.source_root, | ||
249 | module_id, | ||
250 | source_item_id: item.id, | ||
251 | }; | ||
252 | def_loc.id(self.db) | ||
253 | }); | ||
254 | let resolution = Resolution { | 238 | let resolution = Resolution { |
255 | def_id, | 239 | def_id, |
256 | import: None, | 240 | import: None, |
257 | }; | 241 | }; |
258 | module_items.items.insert(item.name.clone(), resolution); | 242 | module_items.items.insert(name.clone(), resolution); |
259 | } | 243 | } |
260 | 244 | ||
261 | // Populate modules | 245 | // Populate modules |