mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Re-implement InFile wrappers as type aliases over generic InFileWrapper
This commit is contained in:
parent
30093a6d81
commit
c43078f99d
13 changed files with 151 additions and 107 deletions
|
@ -7,7 +7,7 @@ use hir_def::{
|
|||
AdtId, AssocItemId, DefWithBodyId, HasModule, ImplId, Lookup, MacroId, ModuleDefId, ModuleId,
|
||||
TraitId,
|
||||
};
|
||||
use hir_expand::{files::ascend_range_up_macros, HirFileId, InFile};
|
||||
use hir_expand::{HirFileId, InFile};
|
||||
use hir_ty::db::HirDatabase;
|
||||
use syntax::{ast::HasName, AstNode, SmolStr, SyntaxNode, SyntaxNodePtr};
|
||||
|
||||
|
@ -51,8 +51,7 @@ impl DeclarationLocation {
|
|||
}
|
||||
|
||||
pub fn original_name_range(&self, db: &dyn HirDatabase) -> FileRange {
|
||||
let mapping = InFile::new(self.hir_file_id, self.name_ptr.text_range());
|
||||
ascend_range_up_macros(db.upcast(), mapping).0
|
||||
InFile::new(self.hir_file_id, self.name_ptr.text_range()).original_file_range(db.upcast())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue