Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/db.rs')
| -rw-r--r-- | crates/hir-def/src/db.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/crates/hir-def/src/db.rs b/crates/hir-def/src/db.rs index e0918d6850..d3f436be0b 100644 --- a/crates/hir-def/src/db.rs +++ b/crates/hir-def/src/db.rs @@ -298,7 +298,6 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId { } }; - // FIXME: The def site spans here are wrong, those should point to the name, not the whole ast node match id { MacroId::Macro2Id(it) => { let loc: Macro2Loc = it.lookup(db); @@ -310,9 +309,7 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId { kind: kind(loc.expander, loc.id.file_id(), makro.ast_id.upcast()), local_inner: false, allow_internal_unsafe: loc.allow_internal_unsafe, - span: db - .span_map(loc.id.file_id()) - .span_for_range(db.ast_id_map(loc.id.file_id()).get(makro.ast_id).text_range()), + span: makro.def_site, edition: loc.edition, } } @@ -328,9 +325,7 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId { allow_internal_unsafe: loc .flags .contains(MacroRulesLocFlags::ALLOW_INTERNAL_UNSAFE), - span: db - .span_map(loc.id.file_id()) - .span_for_range(db.ast_id_map(loc.id.file_id()).get(makro.ast_id).text_range()), + span: makro.def_site, edition: loc.edition, } } @@ -348,6 +343,7 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId { ), local_inner: false, allow_internal_unsafe: false, + // FIXME: This is wrong, this should point to the name span: db .span_map(loc.id.file_id()) .span_for_range(db.ast_id_map(loc.id.file_id()).get(makro.ast_id).text_range()), |