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

Incorrect dartdoc reference #121422

Closed
goderbauer opened this issue Feb 24, 2023 · 7 comments · Fixed by flutter/engine#39954
Closed

Incorrect dartdoc reference #121422

goderbauer opened this issue Feb 24, 2023 · 7 comments · Fixed by flutter/engine#39954
Labels
dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list

Comments

@goderbauer
Copy link
Member

https://github.com/flutter/engine/blob/11b4380b622f3e3ee71ae2ec99fb6912ca5876cf/lib/ui/text.dart#L2057

The [Text] reference in the docs from dart:ui linked above is supposed to link to the Text widget from package:flutter/widgets.dart [1], instead it links to the Text class from dart:html [2].

[1] https://master-api.flutter.dev/flutter/widgets/Text-class.html
[2] https://master-api.flutter.dev/flutter/dart-html/Text-class.html

@goderbauer goderbauer added engine flutter/engine repository. See also e: labels. dependency: dart Dart team may need to help us documentation labels Feb 24, 2023
@goderbauer
Copy link
Member Author

@srawlins @jcollins-g Is there anything we can do to guide dartdoc to link to the right class? Also, is there some kind of a way to specify globally what references take precedence if there are multiple candidates? We probably always want to prefer linking to things in dart:ui or package:flutter over linking to some obscure thing in another dart: library or third-party package.

cc @gspencergoog

@goderbauer
Copy link
Member Author

goderbauer commented Feb 24, 2023

Interestingly, dartdoc also thinks that this [Text.rich] reference is unresolvable:

https://github.com/flutter/engine/blob/11b4380b622f3e3ee71ae2ec99fb6912ca5876cf/lib/ui/text.dart#L179

Probably because Text from dart:html doesn't have a rich constructor, unlike the one from package:flutter/widgets.dart, which should have been the link target...

@srawlins
Copy link
Contributor

@srawlins @jcollins-g Is there anything we can do to guide dartdoc to link to the right class? Also, is there some kind of a way to specify globally what references take precedence if there are multiple candidates?

No, that feature is dart-lang/sdk#50702.

@jcollins-g
Copy link
Contributor

@goderbauer You can attempt to force the heuristics to obey you by specifying the library name and/or package name in the comment reference. [widgets.Text.rich] or [widgets.Text] is more likely to work, [flutter.widgets.Text.rich] should also work. What we really need however is the feature @srawlins mentioned because there is no way to implement this reasonably in the analyzer. Arguably, it is implemented unreasonably in dartdoc....

@chinmaygarde chinmaygarde added the P2 Important issues not at the top of the work list label Feb 27, 2023
@chinmaygarde
Copy link
Member

Blocked on the the cross referenced issue.

@goderbauer
Copy link
Member Author

[widgets.Text.rich] did the trick, thanks @jcollins-g!

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants