From fb21a215be0968d1102aba842c0fdedcd401cb15 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 7 Dec 2020 17:06:14 +0100 Subject: Retain types of proc macros and allow attr. macros --- crates/base_db/src/input.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crates/base_db/src/input.rs') diff --git a/crates/base_db/src/input.rs b/crates/base_db/src/input.rs index 98ba372ad..cda5e57dc 100644 --- a/crates/base_db/src/input.rs +++ b/crates/base_db/src/input.rs @@ -143,9 +143,17 @@ impl CrateDisplayName { #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct ProcMacroId(pub u32); +#[derive(Copy, Clone, Eq, PartialEq, Debug)] +pub enum ProcMacroKind { + CustomDerive, + FuncLike, + Attr, +} + #[derive(Debug, Clone)] pub struct ProcMacro { pub name: SmolStr, + pub kind: ProcMacroKind, pub expander: Arc, } @@ -198,11 +206,8 @@ impl CrateGraph { display_name: Option, cfg_options: CfgOptions, env: Env, - proc_macro: Vec<(SmolStr, Arc)>, + proc_macro: Vec, ) -> CrateId { - let proc_macro = - proc_macro.into_iter().map(|(name, it)| ProcMacro { name, expander: it }).collect(); - let data = CrateData { root_file_id: file_id, edition, -- cgit v1.2.3