diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-29 19:33:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-29 19:33:49 +0100 |
commit | 505329b9bb66484276f2b04ee2aa2c59ccce72d6 (patch) | |
tree | 127d90ba4f4eac66081f9b78a2d53d2d713a0593 /crates/hir_def/src/nameres/proc_macro.rs | |
parent | f6da603c7fe56c19a275dc7bab1f30fe1ad39707 (diff) | |
parent | 8c639a87bdbd08b10d4eb84d00f25ba7bcd56be0 (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.rs | 10 |
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 | ||
21 | impl 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 | |||
21 | impl Attrs { | 31 | impl 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> { |