mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Use original_file
instead of as_original_file
This commit is contained in:
parent
3b4c506f33
commit
04741ae2bc
2 changed files with 4 additions and 4 deletions
|
@ -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(),
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue