From a69cccfc0e40095f3f9f9b73eeeb4ac913ee3796 Mon Sep 17 00:00:00 2001 From: DropDemBits Date: Sun, 9 Oct 2022 21:28:21 -0400 Subject: [PATCH] Underline only the intra-doc link instead of the whole doc comment --- crates/ide/src/goto_definition.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index f86ea61d158..d0be1b3f404 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -48,10 +48,14 @@ pub(crate) fn goto_definition( _ => 1, })?; if let Some(doc_comment) = token_as_doc_comment(&original_token) { - return doc_comment.get_definition_with_descend_at(sema, position.offset, |def, _, _| { - let nav = def.try_to_nav(db)?; - Some(RangeInfo::new(original_token.text_range(), vec![nav])) - }); + return doc_comment.get_definition_with_descend_at( + sema, + position.offset, + |def, _, link_range| { + let nav = def.try_to_nav(db)?; + Some(RangeInfo::new(link_range, vec![nav])) + }, + ); } let navs = sema .descend_into_macros(original_token.clone())