Skip to content

canonicalization is sometimes failing to return any results for links to extension methods #3325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
natebosch opened this issue Feb 6, 2023 · 3 comments · Fixed by #3393
Closed
Assignees
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@natebosch
Copy link
Member

I have an extension CoreChecks which is in scope, that extension defines a method equals. I hoped that a doc comment /// [CoreChecks.equals] would have a link to the docs for equals, but it renders as a code block instead of a link.

The analyzer jump to definition does work so this is a case where analyzer and dart doc disagree about comment references.

@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Feb 6, 2023
@jcollins-g
Copy link
Contributor

dartdoc does not print an error message and so knows what this refers to but doesn't link it for some reason.

@jcollins-g jcollins-g added the P2 A bug or feature request we're likely to work on label Feb 14, 2023
@jcollins-g jcollins-g self-assigned this Feb 14, 2023
@jamesderlin
Copy link

Links to extension methods seem to work in some of the cases where I've tried it, so maybe there's something weird about this specific case? (The cases I tried were within the same .dart file where the extension was defined, however.)

@jcollins-g
Copy link
Contributor

I spent a bit of time spelunking and this is a specific problem related to the example; most links work, however it seems that canonicalization is not returning correct results in this case. To explain briefly, first Dartdoc asks "where does this comment reference point to in the code". Here it gets the same result as the analyzer... all good. However, then Dartdoc tries to figure out "where is this code actually documented", so it can generate a link. This is complicated because the same bit of code can appear in the API surface of multiple libraries or classes depending on inheritance and the import/export graph. Dartdoc is not figuring this part out correctly, hence the missing link.

@jcollins-g jcollins-g changed the title Links to extension methods do not work canonicalization is sometimes failing to return any results for links to extension methods Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants