diff options
author | Edwin Cheng <[email protected]> | 2020-12-18 02:26:17 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-12-18 02:26:17 +0000 |
commit | 60a3785ac27d7361617977bd53e11f2859e97c7c (patch) | |
tree | b79241db7008f95204b42e45a41dcbc4d07bda99 /crates/ide/src/hover.rs | |
parent | c1c36acb025880c742c65f436a61fd87fc627eb0 (diff) |
Temp fixes panic caused by no ast for proc-macro
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index ab017d2ad..c03dd74e4 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -324,6 +324,12 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> { | |||
324 | let mod_path = definition_mod_path(db, &def); | 324 | let mod_path = definition_mod_path(db, &def); |
325 | return match def { | 325 | return match def { |
326 | Definition::Macro(it) => { | 326 | Definition::Macro(it) => { |
327 | // FIXME: Currently proc-macro do not have ast-node, | ||
328 | // such that it does not have source | ||
329 | // more discussion: https://github.com/rust-analyzer/rust-analyzer/issues/6913 | ||
330 | if it.is_proc_macro() { | ||
331 | return None; | ||
332 | } | ||
327 | let label = macro_label(&it.source(db).value); | 333 | let label = macro_label(&it.source(db).value); |
328 | from_def_source_labeled(db, it, Some(label), mod_path) | 334 | from_def_source_labeled(db, it, Some(label), mod_path) |
329 | } | 335 | } |