mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Move ide crates to new hir::Macro
This commit is contained in:
parent
c04b0f435b
commit
eba90936c1
24 changed files with 61 additions and 67 deletions
|
@ -5,7 +5,6 @@ mod tests;
|
|||
|
||||
mod intra_doc_links;
|
||||
|
||||
use either::Either;
|
||||
use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag};
|
||||
use pulldown_cmark_to_cmark::{cmark_resume_with_options, Options as CMarkOptions};
|
||||
use stdx::format_to;
|
||||
|
@ -173,7 +172,7 @@ pub(crate) fn resolve_doc_path_for_def(
|
|||
link: &str,
|
||||
ns: Option<hir::Namespace>,
|
||||
) -> Option<Definition> {
|
||||
let def = match def {
|
||||
match def {
|
||||
Definition::Module(it) => it.resolve_doc_path(db, link, ns),
|
||||
Definition::Function(it) => it.resolve_doc_path(db, link, ns),
|
||||
Definition::Adt(it) => it.resolve_doc_path(db, link, ns),
|
||||
|
@ -191,11 +190,8 @@ pub(crate) fn resolve_doc_path_for_def(
|
|||
| Definition::Local(_)
|
||||
| Definition::GenericParam(_)
|
||||
| Definition::Label(_) => None,
|
||||
}?;
|
||||
match def {
|
||||
Either::Left(def) => Some(Definition::from(def)),
|
||||
Either::Right(def) => Some(Definition::Macro(def)),
|
||||
}
|
||||
.map(Definition::from)
|
||||
}
|
||||
|
||||
pub(crate) fn doc_attributes(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue