Underline only the intra-doc link instead of the whole doc comment

This commit is contained in:
DropDemBits 2022-10-09 21:28:21 -04:00
parent 8437e4ba58
commit a69cccfc0e

View File

@ -48,10 +48,14 @@ pub(crate) fn goto_definition(
_ => 1, _ => 1,
})?; })?;
if let Some(doc_comment) = token_as_doc_comment(&original_token) { if let Some(doc_comment) = token_as_doc_comment(&original_token) {
return doc_comment.get_definition_with_descend_at(sema, position.offset, |def, _, _| { return doc_comment.get_definition_with_descend_at(
let nav = def.try_to_nav(db)?; sema,
Some(RangeInfo::new(original_token.text_range(), vec![nav])) position.offset,
}); |def, _, link_range| {
let nav = def.try_to_nav(db)?;
Some(RangeInfo::new(link_range, vec![nav]))
},
);
} }
let navs = sema let navs = sema
.descend_into_macros(original_token.clone()) .descend_into_macros(original_token.clone())