aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/nameres.rs')
-rw-r--r--crates/ra_hir_def/src/nameres.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs
index 2359386c2..df42ea84a 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_hir_def/src/nameres.rs
@@ -58,8 +58,8 @@ mod tests;
58use std::sync::Arc; 58use std::sync::Arc;
59 59
60use hir_expand::{ 60use hir_expand::{
61 ast_id_map::FileAstId, diagnostics::DiagnosticSink, either::Either, name::Name, MacroDefId, 61 ast_id_map::FileAstId, diagnostics::DiagnosticSink, either::Either, name::Name, InFile,
62 Source, 62 MacroDefId,
63}; 63};
64use once_cell::sync::Lazy; 64use once_cell::sync::Lazy;
65use ra_arena::Arena; 65use ra_arena::Arena;
@@ -261,21 +261,21 @@ impl ModuleData {
261 pub fn definition_source( 261 pub fn definition_source(
262 &self, 262 &self,
263 db: &impl DefDatabase, 263 db: &impl DefDatabase,
264 ) -> Source<Either<ast::SourceFile, ast::Module>> { 264 ) -> InFile<Either<ast::SourceFile, ast::Module>> {
265 if let Some(file_id) = self.definition { 265 if let Some(file_id) = self.definition {
266 let sf = db.parse(file_id).tree(); 266 let sf = db.parse(file_id).tree();
267 return Source::new(file_id.into(), Either::A(sf)); 267 return InFile::new(file_id.into(), Either::A(sf));
268 } 268 }
269 let decl = self.declaration.unwrap(); 269 let decl = self.declaration.unwrap();
270 Source::new(decl.file_id(), Either::B(decl.to_node(db))) 270 InFile::new(decl.file_id, Either::B(decl.to_node(db)))
271 } 271 }
272 272
273 /// Returns a node which declares this module, either a `mod foo;` or a `mod foo {}`. 273 /// Returns a node which declares this module, either a `mod foo;` or a `mod foo {}`.
274 /// `None` for the crate root. 274 /// `None` for the crate root.
275 pub fn declaration_source(&self, db: &impl DefDatabase) -> Option<Source<ast::Module>> { 275 pub fn declaration_source(&self, db: &impl DefDatabase) -> Option<InFile<ast::Module>> {
276 let decl = self.declaration?; 276 let decl = self.declaration?;
277 let value = decl.to_node(db); 277 let value = decl.to_node(db);
278 Some(Source { file_id: decl.file_id(), value }) 278 Some(InFile { file_id: decl.file_id, value })
279 } 279 }
280} 280}
281 281
@@ -309,7 +309,7 @@ mod diagnostics {
309 } 309 }
310 let decl = declaration.to_node(db); 310 let decl = declaration.to_node(db);
311 sink.push(UnresolvedModule { 311 sink.push(UnresolvedModule {
312 file: declaration.file_id(), 312 file: declaration.file_id,
313 decl: AstPtr::new(&decl), 313 decl: AstPtr::new(&decl),
314 candidate: candidate.clone(), 314 candidate: candidate.clone(),
315 }) 315 })