mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Simplify
This commit is contained in:
parent
d571ca814e
commit
3fab50019c
4 changed files with 10 additions and 12 deletions
|
@ -43,11 +43,10 @@ pub(crate) fn goto_definition(
|
|||
let parent = token.parent()?;
|
||||
if let Some(_) = ast::Comment::cast(token.clone()) {
|
||||
let (attributes, def) = doc_attributes(&sema, &parent)?;
|
||||
|
||||
let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?;
|
||||
let (_, link, ns) =
|
||||
extract_definitions_from_docs(&docs).into_iter().find(|(range, ..)| {
|
||||
doc_mapping.map(*range).map_or(false, |InFile { file_id, value: range }| {
|
||||
extract_definitions_from_docs(&docs).into_iter().find(|&(range, ..)| {
|
||||
doc_mapping.map(range).map_or(false, |InFile { file_id, value: range }| {
|
||||
file_id == position.file_id.into() && range.contains(position.offset)
|
||||
})
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue