aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/proc_macro.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-29 19:33:49 +0100
committerGitHub <[email protected]>2021-05-29 19:33:49 +0100
commit505329b9bb66484276f2b04ee2aa2c59ccce72d6 (patch)
tree127d90ba4f4eac66081f9b78a2d53d2d713a0593 /crates/hir_def/src/nameres/proc_macro.rs
parentf6da603c7fe56c19a275dc7bab1f30fe1ad39707 (diff)
parent8c639a87bdbd08b10d4eb84d00f25ba7bcd56be0 (diff)
Merge #9057
9057: internal: Thread proc-macro types through the HIR r=jonas-schievink a=jonas-schievink Should help with completion of derives. cc @Veykril bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/proc_macro.rs')
-rw-r--r--crates/hir_def/src/nameres/proc_macro.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/proc_macro.rs b/crates/hir_def/src/nameres/proc_macro.rs
index 156598f19..3f095d623 100644
--- a/crates/hir_def/src/nameres/proc_macro.rs
+++ b/crates/hir_def/src/nameres/proc_macro.rs
@@ -18,6 +18,16 @@ pub(super) enum ProcMacroKind {
18 Attr, 18 Attr,
19} 19}
20 20
21impl ProcMacroKind {
22 pub(super) fn to_basedb_kind(&self) -> base_db::ProcMacroKind {
23 match self {
24 ProcMacroKind::CustomDerive { .. } => base_db::ProcMacroKind::CustomDerive,
25 ProcMacroKind::FnLike => base_db::ProcMacroKind::FuncLike,
26 ProcMacroKind::Attr => base_db::ProcMacroKind::Attr,
27 }
28 }
29}
30
21impl Attrs { 31impl Attrs {
22 #[rustfmt::skip] 32 #[rustfmt::skip]
23 pub(super) fn parse_proc_macro_decl(&self, func_name: &Name) -> Option<ProcMacroDef> { 33 pub(super) fn parse_proc_macro_decl(&self, func_name: &Name) -> Option<ProcMacroDef> {