diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index fca3a2950..4cd28eb4e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -12,8 +12,8 @@ use hir_def::{ | |||
12 | resolver::HasResolver, | 12 | resolver::HasResolver, |
13 | type_ref::{Mutability, TypeRef}, | 13 | type_ref::{Mutability, TypeRef}, |
14 | AdtId, ConstId, DefWithBodyId, EnumId, FunctionId, HasModule, ImplId, LocalEnumVariantId, | 14 | AdtId, ConstId, DefWithBodyId, EnumId, FunctionId, HasModule, ImplId, LocalEnumVariantId, |
15 | LocalImportId, LocalModuleId, LocalStructFieldId, Lookup, ModuleId, StaticId, StructId, | 15 | LocalModuleId, LocalStructFieldId, Lookup, ModuleId, StaticId, StructId, TraitId, TypeAliasId, |
16 | TraitId, TypeAliasId, TypeParamId, UnionId, | 16 | TypeParamId, UnionId, |
17 | }; | 17 | }; |
18 | use hir_expand::{ | 18 | use hir_expand::{ |
19 | diagnostics::DiagnosticSink, | 19 | diagnostics::DiagnosticSink, |
@@ -180,13 +180,11 @@ impl Module { | |||
180 | } | 180 | } |
181 | 181 | ||
182 | /// Returns a `ModuleScope`: a set of items, visible in this module. | 182 | /// Returns a `ModuleScope`: a set of items, visible in this module. |
183 | pub fn scope(self, db: &impl HirDatabase) -> Vec<(Name, ScopeDef, Option<Import>)> { | 183 | pub fn scope(self, db: &impl HirDatabase) -> Vec<(Name, ScopeDef)> { |
184 | db.crate_def_map(self.id.krate)[self.id.local_id] | 184 | db.crate_def_map(self.id.krate)[self.id.local_id] |
185 | .scope | 185 | .scope |
186 | .entries() | 186 | .entries() |
187 | .map(|(name, res)| { | 187 | .map(|(name, res)| (name.clone(), res.def.into())) |
188 | (name.clone(), res.def.into(), res.import.map(|id| Import { parent: self, id })) | ||
189 | }) | ||
190 | .collect() | 188 | .collect() |
191 | } | 189 | } |
192 | 190 | ||
@@ -229,11 +227,6 @@ impl Module { | |||
229 | } | 227 | } |
230 | } | 228 | } |
231 | 229 | ||
232 | pub struct Import { | ||
233 | pub(crate) parent: Module, | ||
234 | pub(crate) id: LocalImportId, | ||
235 | } | ||
236 | |||
237 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 230 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
238 | pub struct StructField { | 231 | pub struct StructField { |
239 | pub(crate) parent: VariantDef, | 232 | pub(crate) parent: VariantDef, |