aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/lib.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 01b2de515..975ae4869 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -1282,10 +1282,16 @@ impl BuiltinType {
1282 1282
1283#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 1283#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
1284pub enum MacroKind { 1284pub enum MacroKind {
1285 /// `macro_rules!` or Macros 2.0 macro.
1285 Declarative, 1286 Declarative,
1286 ProcMacro, 1287 /// A built-in or custom derive.
1287 Derive, 1288 Derive,
1289 /// A built-in function-like macro.
1288 BuiltIn, 1290 BuiltIn,
1291 /// A procedural attribute macro.
1292 Attr,
1293 /// A function-like procedural macro.
1294 ProcMacro,
1289} 1295}
1290 1296
1291#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 1297#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
@@ -1315,11 +1321,13 @@ impl MacroDef {
1315 pub fn kind(&self) -> MacroKind { 1321 pub fn kind(&self) -> MacroKind {
1316 match self.id.kind { 1322 match self.id.kind {
1317 MacroDefKind::Declarative(_) => MacroKind::Declarative, 1323 MacroDefKind::Declarative(_) => MacroKind::Declarative,
1318 MacroDefKind::BuiltIn(_, _) => MacroKind::BuiltIn, 1324 MacroDefKind::BuiltIn(_, _) | MacroDefKind::BuiltInEager(_, _) => MacroKind::BuiltIn,
1319 MacroDefKind::BuiltInDerive(_, _) => MacroKind::Derive, 1325 MacroDefKind::BuiltInDerive(_, _) => MacroKind::Derive,
1320 MacroDefKind::BuiltInEager(_, _) => MacroKind::BuiltIn, 1326 MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::CustomDerive, _) => {
1321 // FIXME might be a derive 1327 MacroKind::Derive
1322 MacroDefKind::ProcMacro(_, _) => MacroKind::ProcMacro, 1328 }
1329 MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::Attr, _) => MacroKind::Attr,
1330 MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::FuncLike, _) => MacroKind::ProcMacro,
1323 } 1331 }
1324 } 1332 }
1325} 1333}