mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Store an AstId
for procedural macros
This commit is contained in:
parent
3ab9b39dd4
commit
c05a1a6e37
11 changed files with 47 additions and 26 deletions
|
@ -331,10 +331,16 @@ fn hover_for_definition(
|
|||
) -> Option<Markup> {
|
||||
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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue