mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Refactor
This commit is contained in:
parent
a4966c9282
commit
a0a7860141
2 changed files with 78 additions and 75 deletions
|
@ -4,7 +4,6 @@ use hir_def::{
|
|||
attr::{AttrsWithOwner, Documentation},
|
||||
item_scope::ItemInNs,
|
||||
path::ModPath,
|
||||
per_ns::PerNs,
|
||||
resolver::HasResolver,
|
||||
AttrDefId, GenericParamId, ModuleDefId,
|
||||
};
|
||||
|
@ -155,14 +154,14 @@ fn resolve_doc_path(
|
|||
.syntax_node()
|
||||
.descendants()
|
||||
.find_map(ast::Path::cast)?;
|
||||
if ast_path.to_string() != link {
|
||||
if ast_path.syntax().text() != link {
|
||||
return None;
|
||||
}
|
||||
ModPath::from_src(db.upcast(), ast_path, &Hygiene::new_unhygienic())?
|
||||
};
|
||||
|
||||
let resolved = resolver.resolve_module_path_in_items(db.upcast(), &modpath);
|
||||
let resolved = if resolved == PerNs::none() {
|
||||
let resolved = if resolved.is_none() {
|
||||
resolver.resolve_module_path_in_trait_assoc_items(db.upcast(), &modpath)?
|
||||
} else {
|
||||
resolved
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue