Correctly generate link fragments for associated items

This commit is contained in:
Lukas Wirth 2021-07-20 16:01:27 +02:00
parent 113beab473
commit e8f1abf5f7
4 changed files with 164 additions and 124 deletions

View file

@ -11,7 +11,7 @@ use syntax::{
};
use crate::{
doc_links::{doc_attributes, extract_definitions_from_markdown, resolve_doc_path_for_def},
doc_links::{doc_attributes, extract_definitions_from_docs, resolve_doc_path_for_def},
Analysis, HlMod, HlRange, HlTag, RootDatabase,
};
@ -104,7 +104,7 @@ pub(super) fn doc_comment(
let mut string;
if let Some((docs, doc_mapping)) = attributes.docs_with_rangemap(sema.db) {
extract_definitions_from_markdown(docs.as_str())
extract_definitions_from_docs(&docs)
.into_iter()
.filter_map(|(range, link, ns)| {
let def = resolve_doc_path_for_def(sema.db, def, &link, ns)?;