mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Temp fixes panic caused by no ast for proc-macro
This commit is contained in:
parent
c1c36acb02
commit
60a3785ac2
4 changed files with 22 additions and 1 deletions
|
@ -324,6 +324,12 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
|
|||
let mod_path = definition_mod_path(db, &def);
|
||||
return match def {
|
||||
Definition::Macro(it) => {
|
||||
// FIXME: Currently proc-macro do not have ast-node,
|
||||
// such that it does not have source
|
||||
// more discussion: https://github.com/rust-analyzer/rust-analyzer/issues/6913
|
||||
if it.is_proc_macro() {
|
||||
return None;
|
||||
}
|
||||
let label = macro_label(&it.source(db).value);
|
||||
from_def_source_labeled(db, it, Some(label), mod_path)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue