Skip to content
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

[doc_imports] Overridding members with no doc comments don't have resolvable references #3760

Open
kallentu opened this issue Apr 29, 2024 · 2 comments
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@kallentu
Copy link
Member

Overridden members with no doc comment inherit the doc comment of the original member they are overriding.

This is done through Dartdoc, so the analyzer reference resolving doesn't know there's any references to even resolve on the overriding member.

Background:

An example of overridden members and their Dartdocs: DiagnosticableNode<T extends Diagnosticable> overrides emptyBodyDescription from DiagnosticsNode without adding a doc comment.

See:
https://api.flutter.dev/flutter/foundation/DiagnosticableNode/emptyBodyDescription.html
https://api.flutter.dev/flutter/foundation/DiagnosticsNode/emptyBodyDescription.html

Dartdoc inherits the original doc comment to put on DiagnosticableNode.

If there were references on original doc comment, the analyzer doesn’t know about these references, meaning that it won’t have any resolved references to pass to Dartdoc to use.

Future work

This issue needs to be resolved to allow the usage of @docImports.

We can choose not to make a new, duplicate page/docs for overriding members that have no doc comments.
I'm hoping we do that instead. It would also make it less confusing and cut down on pages.

Otherwise, we need another mechanism to resolve these inherited references (and add the doc imports if the references need importing). But having phantom doc imports where you can't even tell why it's there is not ideal.

@kallentu
Copy link
Member Author

cc @srawlins

@kallentu kallentu changed the title Overridding members with no doc comments don't have resolvable references [docimports] Overridding members with no doc comments don't have resolvable references Apr 29, 2024
@kallentu kallentu changed the title [docimports] Overridding members with no doc comments don't have resolvable references [doc_imports] Overridding members with no doc comments don't have resolvable references Apr 29, 2024
@bwilkerson
Copy link
Member

We already support this behavior in the analysis server for hovers. The analyzer has all the information it needs to allow us to look up the inheritance chain until we find a member with a comment.

@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label May 17, 2024
@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label May 22, 2024
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-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants