How to navigate PsiElement in dart documents?

已回答
MarkdownElementTypes.SHORT_REFERENCE_LINK -> {
    if (node.text.startsWith("[") && node.text.endsWith("]")) {
        val r = node.text.removeSuffix("]").removePrefix("[")
        DocumentationManagerUtil.createHyperlink(sb, "link###$r", r, false, false)
    } else {
        sb.append(node.text)
    }
}

DocumentationManagerUtil.createHyperlink(sb, "link###$r", r, false, false), I used this function, and the generated HTML looks like this <a href="psi_element://link###State"><code>State</code></a> , It can be clicked, but it cannot display the corresponding document (No documentation found.), May I ask how to solve it?

0

Are you trying to replace provided Dart documentation provider?
It seems the issue could be that getDocumentationElementForLink is not implemented in DartDocumentationProvider which is required to resolve such links to actual targets.

0

请先登录再写评论。