From 04741ae2bc70bc002f62b9b142057dd6eabcec75 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Fri, 11 Oct 2019 06:50:53 +0900 Subject: Use `original_file` instead of `as_original_file` --- crates/ra_ide_api/src/display/navigation_target.rs | 6 +++--- crates/ra_ide_api/src/references.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index d0b1a8a2a..5cb67fb95 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs @@ -119,7 +119,7 @@ impl NavigationTarget { pub(crate) fn from_module(db: &RootDatabase, module: hir::Module) -> NavigationTarget { let src = module.definition_source(db); - let file_id = src.file_id.as_original_file(); + let file_id = src.file_id.original_file(db); let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); match src.ast { ModuleSource::SourceFile(node) => { @@ -139,7 +139,7 @@ impl NavigationTarget { pub(crate) fn from_module_to_decl(db: &RootDatabase, module: hir::Module) -> NavigationTarget { let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); if let Some(src) = module.declaration_source(db) { - let file_id = src.file_id.as_original_file(); + let file_id = src.file_id.original_file(db); return NavigationTarget::from_syntax( file_id, name, @@ -213,7 +213,7 @@ impl NavigationTarget { ) -> NavigationTarget { let src = impl_block.source(db); NavigationTarget::from_syntax( - src.file_id.as_original_file(), + src.file_id.original_file(db), "impl".into(), None, src.ast.syntax(), diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs index 84c2eb793..c95c47bf1 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide_api/src/references.rs @@ -140,7 +140,7 @@ fn rename_mod( let module_src = hir::Source { file_id: position.file_id.into(), ast: ast_module.clone() }; if let Some(module) = hir::Module::from_declaration(db, module_src) { let src = module.definition_source(db); - let file_id = src.file_id.as_original_file(); + let file_id = src.file_id.original_file(db); match src.ast { ModuleSource::SourceFile(..) => { let mod_path: RelativePathBuf = db.file_relative_path(file_id); -- cgit v1.2.3