mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-13 09:11:51 +00:00
check module path inner or outer
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
ab4ba5cd29
commit
778322eb31
10 changed files with 256 additions and 130 deletions
|
|
@ -108,10 +108,9 @@ pub fn resolve_doc_path_on(
|
|||
def: impl HasAttrs + Copy,
|
||||
link: &str,
|
||||
ns: Option<Namespace>,
|
||||
is_inner_doc: bool,
|
||||
) -> Option<DocLinkDef> {
|
||||
let is_inner =
|
||||
def.attrs(db).by_key(&intern::sym::doc).attrs().all(|attr| attr.id.is_inner_attr());
|
||||
resolve_doc_path_on_(db, link, def.attr_id(), ns, is_inner)
|
||||
resolve_doc_path_on_(db, link, def.attr_id(), ns, is_inner_doc)
|
||||
}
|
||||
|
||||
fn resolve_doc_path_on_(
|
||||
|
|
@ -119,11 +118,11 @@ fn resolve_doc_path_on_(
|
|||
link: &str,
|
||||
attr_id: AttrDefId,
|
||||
ns: Option<Namespace>,
|
||||
is_inner: bool,
|
||||
is_inner_doc: bool,
|
||||
) -> Option<DocLinkDef> {
|
||||
let resolver = match attr_id {
|
||||
AttrDefId::ModuleId(it) => {
|
||||
if is_inner {
|
||||
if is_inner_doc {
|
||||
it.resolver(db)
|
||||
} else if let Some(parent) = Module::from(it).parent(db) {
|
||||
parent.id.resolver(db)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue