aboutsummaryrefslogtreecommitdiff
path: root/crates/base_db/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/base_db/src')
-rw-r--r--crates/base_db/src/input.rs13
-rw-r--r--crates/base_db/src/lib.rs2
2 files changed, 10 insertions, 5 deletions
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 {
143#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] 143#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
144pub struct ProcMacroId(pub u32); 144pub struct ProcMacroId(pub u32);
145 145
146#[derive(Copy, Clone, Eq, PartialEq, Debug)]
147pub enum ProcMacroKind {
148 CustomDerive,
149 FuncLike,
150 Attr,
151}
152
146#[derive(Debug, Clone)] 153#[derive(Debug, Clone)]
147pub struct ProcMacro { 154pub struct ProcMacro {
148 pub name: SmolStr, 155 pub name: SmolStr,
156 pub kind: ProcMacroKind,
149 pub expander: Arc<dyn TokenExpander>, 157 pub expander: Arc<dyn TokenExpander>,
150} 158}
151 159
@@ -198,11 +206,8 @@ impl CrateGraph {
198 display_name: Option<CrateDisplayName>, 206 display_name: Option<CrateDisplayName>,
199 cfg_options: CfgOptions, 207 cfg_options: CfgOptions,
200 env: Env, 208 env: Env,
201 proc_macro: Vec<(SmolStr, Arc<dyn tt::TokenExpander>)>, 209 proc_macro: Vec<ProcMacro>,
202 ) -> CrateId { 210 ) -> CrateId {
203 let proc_macro =
204 proc_macro.into_iter().map(|(name, it)| ProcMacro { name, expander: it }).collect();
205
206 let data = CrateData { 211 let data = CrateData {
207 root_file_id: file_id, 212 root_file_id: file_id,
208 edition, 213 edition,
diff --git a/crates/base_db/src/lib.rs b/crates/base_db/src/lib.rs
index ce75a5337..5571af495 100644
--- a/crates/base_db/src/lib.rs
+++ b/crates/base_db/src/lib.rs
@@ -14,7 +14,7 @@ pub use crate::{
14 change::Change, 14 change::Change,
15 input::{ 15 input::{
16 CrateData, CrateDisplayName, CrateGraph, CrateId, CrateName, Dependency, Edition, Env, 16 CrateData, CrateDisplayName, CrateGraph, CrateId, CrateName, Dependency, Edition, Env,
17 ProcMacroId, SourceRoot, SourceRootId, 17 ProcMacro, ProcMacroId, ProcMacroKind, SourceRoot, SourceRootId,
18 }, 18 },
19}; 19};
20pub use salsa; 20pub use salsa;