mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
resolve_doc_path is able to resolve to macros
This commit is contained in:
parent
df0936b4af
commit
62ab73767f
6 changed files with 121 additions and 75 deletions
|
@ -150,7 +150,10 @@ pub(crate) fn hover(
|
|||
(file_id == position.file_id.into() && mapped_range.contains(position.offset)).then(||(mapped_range, link, ns))
|
||||
})?;
|
||||
range = Some(idl_range);
|
||||
resolve_doc_path_for_def(db, def, &link, ns).map(Definition::ModuleDef)
|
||||
Some(match resolve_doc_path_for_def(db,def, &link,ns)? {
|
||||
Either::Left(it) => Definition::ModuleDef(it),
|
||||
Either::Right(it) => Definition::Macro(it),
|
||||
})
|
||||
} else if let Some(attr) = token.ancestors().find_map(ast::Attr::cast) {
|
||||
if let res@Some(_) = try_hover_for_lint(&attr, &token) {
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue