From c05a1a6e37156b956380d57049a72cfe6f21095d Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 18 Mar 2021 16:11:18 +0100 Subject: Store an `AstId` for procedural macros --- crates/ide/src/hover.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'crates/ide/src/hover.rs') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 15d309d7d..a3fb17c0a 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -331,10 +331,16 @@ fn hover_for_definition( ) -> Option { let mod_path = definition_mod_path(db, &def); return match def { - Definition::Macro(it) => { - let label = macro_label(&it.source(db)?.value); - from_def_source_labeled(db, it, Some(label), mod_path) - } + Definition::Macro(it) => match &it.source(db)?.value { + Either::Left(mac) => { + let label = macro_label(&mac); + from_def_source_labeled(db, it, Some(label), mod_path) + } + Either::Right(_) => { + // FIXME + None + } + }, Definition::Field(def) => from_hir_fmt(db, def, mod_path), Definition::ModuleDef(it) => match it { ModuleDef::Module(it) => from_hir_fmt(db, it, mod_path), -- cgit v1.2.3