aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/lib.rs')
-rw-r--r--crates/hir_def/src/lib.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs
index eefc75706..ffee05500 100644
--- a/crates/hir_def/src/lib.rs
+++ b/crates/hir_def/src/lib.rs
@@ -62,7 +62,7 @@ use hir_expand::{
62 ast_id_map::FileAstId, 62 ast_id_map::FileAstId,
63 eager::{expand_eager_macro, ErrorEmitted, ErrorSink}, 63 eager::{expand_eager_macro, ErrorEmitted, ErrorSink},
64 hygiene::Hygiene, 64 hygiene::Hygiene,
65 AstId, HirFileId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, 65 AstId, AttrId, HirFileId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
66}; 66};
67use la_arena::Idx; 67use la_arena::Idx;
68use nameres::DefMap; 68use nameres::DefMap;
@@ -700,13 +700,16 @@ fn macro_call_as_call_id(
700 ) 700 )
701 .map(MacroCallId::from) 701 .map(MacroCallId::from)
702 } else { 702 } else {
703 Ok(def.as_lazy_macro(db.upcast(), krate, MacroCallKind::FnLike(call.ast_id)).into()) 703 Ok(def
704 .as_lazy_macro(db.upcast(), krate, MacroCallKind::FnLike { ast_id: call.ast_id })
705 .into())
704 }; 706 };
705 Ok(res) 707 Ok(res)
706} 708}
707 709
708fn derive_macro_as_call_id( 710fn derive_macro_as_call_id(
709 item_attr: &AstIdWithPath<ast::Item>, 711 item_attr: &AstIdWithPath<ast::Item>,
712 derive_attr: AttrId,
710 db: &dyn db::DefDatabase, 713 db: &dyn db::DefDatabase,
711 krate: CrateId, 714 krate: CrateId,
712 resolver: impl Fn(path::ModPath) -> Option<MacroDefId>, 715 resolver: impl Fn(path::ModPath) -> Option<MacroDefId>,
@@ -717,7 +720,11 @@ fn derive_macro_as_call_id(
717 .as_lazy_macro( 720 .as_lazy_macro(
718 db.upcast(), 721 db.upcast(),
719 krate, 722 krate,
720 MacroCallKind::Derive(item_attr.ast_id, last_segment.to_string()), 723 MacroCallKind::Derive {
724 ast_id: item_attr.ast_id,
725 derive_name: last_segment.to_string(),
726 derive_attr,
727 },
721 ) 728 )
722 .into(); 729 .into();
723 Ok(res) 730 Ok(res)