diff options
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 8194f38d4..646b603d3 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -48,8 +48,8 @@ impl HasSource for ImplBlock { | |||
48 | type Ast = TreeArc<ast::ImplBlock>; | 48 | type Ast = TreeArc<ast::ImplBlock>; |
49 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::ImplBlock>> { | 49 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::ImplBlock>> { |
50 | let source_map = db.impls_in_module_with_source_map(self.module).1; | 50 | let source_map = db.impls_in_module_with_source_map(self.module).1; |
51 | let (file_id, source) = self.module.definition_source(db); | 51 | let src = self.module.definition_source(db); |
52 | (file_id, source_map.get(&source, self.impl_id)).into() | 52 | (src.file_id, source_map.get(&src.ast, self.impl_id)).into() |
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
@@ -69,8 +69,8 @@ impl ImplBlock { | |||
69 | /// Returns the syntax of the impl block | 69 | /// Returns the syntax of the impl block |
70 | pub fn source(&self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::ImplBlock>> { | 70 | pub fn source(&self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::ImplBlock>> { |
71 | let source_map = db.impls_in_module_with_source_map(self.module).1; | 71 | let source_map = db.impls_in_module_with_source_map(self.module).1; |
72 | let (file_id, source) = self.module.definition_source(db); | 72 | let src = self.module.definition_source(db); |
73 | (file_id, source_map.get(&source, self.impl_id)).into() | 73 | (src.file_id, source_map.get(&src.ast, self.impl_id)).into() |
74 | } | 74 | } |
75 | 75 | ||
76 | pub fn id(&self) -> ImplId { | 76 | pub fn id(&self) -> ImplId { |
@@ -207,8 +207,8 @@ impl ModuleImplBlocks { | |||
207 | impls_by_def: FxHashMap::default(), | 207 | impls_by_def: FxHashMap::default(), |
208 | }; | 208 | }; |
209 | 209 | ||
210 | let (file_id, module_source) = m.module.definition_source(db); | 210 | let src = m.module.definition_source(db); |
211 | let node = match &module_source { | 211 | let node = match &src.ast { |
212 | ModuleSource::SourceFile(node) => node.syntax(), | 212 | ModuleSource::SourceFile(node) => node.syntax(), |
213 | ModuleSource::Module(node) => { | 213 | ModuleSource::Module(node) => { |
214 | node.item_list().expect("inline module should have item list").syntax() | 214 | node.item_list().expect("inline module should have item list").syntax() |
@@ -216,7 +216,7 @@ impl ModuleImplBlocks { | |||
216 | }; | 216 | }; |
217 | 217 | ||
218 | for impl_block_ast in node.children().filter_map(ast::ImplBlock::cast) { | 218 | for impl_block_ast in node.children().filter_map(ast::ImplBlock::cast) { |
219 | let impl_block = ImplData::from_ast(db, file_id, m.module, impl_block_ast); | 219 | let impl_block = ImplData::from_ast(db, src.file_id, m.module, impl_block_ast); |
220 | let id = m.impls.alloc(impl_block); | 220 | let id = m.impls.alloc(impl_block); |
221 | for &impl_item in &m.impls[id].items { | 221 | for &impl_item in &m.impls[id].items { |
222 | m.impls_by_def.insert(impl_item, id); | 222 | m.impls_by_def.insert(impl_item, id); |