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
generated docs for flutter plugins also include the dart: docs #1431
Comments
This is a dartdocs.org bug, but exactly what sort of dartdocs.org bug is not clear to me. My guess is this probably has something to do with flutter shipping their own SDK and dartdocs.org not excluding the flutter SDK explicitly on the commandline (or incorrectly including it). |
The inclusion of dart:ui in the generated docs would seem to confirm this hypothesis. |
https://www.dartdocs.org/documentation/url_launcher/0.4.1/log.txt The log suggests dartdoc is not recognizing that the flutter SDK isn't part of the package. But why isn't quite as clear. |
@jcollins-g in case you need a local repro, these steps work for me:
|
Any news @jcollins-g? |
I can reproduce it and am working on a set of command line flags for you to use to work around while I come up with a more permanent fix. |
@mit-mit work around with the following command line flag:
This will be safe to use with and without the real fix to this problem. |
demoting to P2 since there is a workaround, but will still try to get this fixed soon. |
This is no longer needed at head; SDK calculation is now smart enough not to try to include the SDK components in flutter plugins. |
… is ready to go before building docs
* Enable flutter plugin test * Plugin makes flutter check take longer again * Add workaround for #1431 and use update-packages to make sure Flutter is ready to go before building docs * flag in wrong place * dartfmt
@jcollins-g Does this fix |
@jcollins-g That workaround doesn't work for me. It's still parsing a whole bunch of files, that are outside the |
Hi @devxpy, dartdoc parses all files in all packages reachable via the import-export tree of your project (this issue was that sometimes we thought we needed to document some of them when that was inappropriate) and this is expected behavior. It needs to do this because of the way dartdoc's macros and comment reference scoping works, though it probably could be optimized to only do this on demand. If it is generating docs for things it should not be though, either this or another bug would be appropriate to open. |
The current mechanism doesn't cache things? |
Sadly, no, it does not cache and indeed therefore does take an absurdly long amount of time. I have had some ideas on how to improve that, but performance for dartdoc has not been a high enough priority to be able to allocate the time. |
@devxpy To expand very briefly, caching is not straightforward for dartdoc as a change in seemingly unrelated files can impact the documentation generated for another file. This is due to the global scope macros and some comment references can have as well as dartdoc's public interface canonicalization. A design to fix this will either have some heuristics to eliminate those problems in common cases, or we can change some of our scoping rules and then adopt the analysis server's strategy of targeted invalidations when changes are detected. Not a trivial amount of work in either case (though certainly not impossible) |
Thank you for the detailed explanation! |
@jcollins-g Would a file-watcher based "hot-reloading" compiler take a similar amount of effort? |
@devxpy Indeed, I would say even more effort. There's a team of folks doing something like that at https://github.com/dart-lang/build, and Flutter of course has hot reloading support. |
Closing as the |
See https://www.dartdocs.org/documentation/url_launcher/0.4.1/ for an example.
The text was updated successfully, but these errors were encountered: