mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Simplify
This commit is contained in:
parent
d571ca814e
commit
3fab50019c
4 changed files with 10 additions and 12 deletions
|
@ -107,9 +107,11 @@ pub(super) fn doc_comment(
|
|||
extract_definitions_from_docs(&docs)
|
||||
.into_iter()
|
||||
.filter_map(|(range, link, ns)| {
|
||||
let def = resolve_doc_path_for_def(sema.db, def, &link, ns)?;
|
||||
let InFile { file_id, value: range } = doc_mapping.map(range)?;
|
||||
(file_id == node.file_id).then(|| (range, def))
|
||||
doc_mapping.map(range).filter(|mapping| mapping.file_id == node.file_id).and_then(
|
||||
|InFile { value: mapped_range, .. }| {
|
||||
Some(mapped_range).zip(resolve_doc_path_for_def(sema.db, def, &link, ns))
|
||||
},
|
||||
)
|
||||
})
|
||||
.for_each(|(range, def)| {
|
||||
hl.add(HlRange {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue