mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Replace ID based TokenMap with proper relative text-ranges / spans
This commit is contained in:
parent
f79439caed
commit
890eb17b4e
80 changed files with 1816 additions and 2046 deletions
|
@ -1,6 +1,9 @@
|
|||
//! Macro expansion utilities.
|
||||
|
||||
use base_db::CrateId;
|
||||
use base_db::{
|
||||
span::{SpanAnchor, ROOT_ERASED_FILE_AST_ID},
|
||||
CrateId,
|
||||
};
|
||||
use cfg::CfgOptions;
|
||||
use drop_bomb::DropBomb;
|
||||
use hir_expand::{
|
||||
|
@ -118,7 +121,17 @@ impl Expander {
|
|||
}
|
||||
|
||||
pub(crate) fn parse_attrs(&self, db: &dyn DefDatabase, owner: &dyn ast::HasAttrs) -> Attrs {
|
||||
Attrs::filter(db, self.krate, RawAttrs::new(db.upcast(), owner, &self.hygiene))
|
||||
Attrs::filter(
|
||||
db,
|
||||
self.krate,
|
||||
RawAttrs::new(
|
||||
db.upcast(),
|
||||
// Usin `ROOT_ERASED_FILE_AST_ID` here is fine as this is only used for cfg checking
|
||||
SpanAnchor { file_id: self.current_file_id, ast_id: ROOT_ERASED_FILE_AST_ID },
|
||||
owner,
|
||||
&self.hygiene,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn cfg_options(&self) -> &CfgOptions {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue