You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Popup tooltip should allow click to navigate to online doc #1571
in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
Not sure if this is possible, but would be very handy is to allow popup tooltips, via a hot key or some additional link, to open browser and navigate to the online (or local) docs.
I'm not sure exactly what you meany by "popup tooltip", but I think having some to jump to online docs for an item is reasonable (since it's often more readable there - esp. with DartDoc replacements - than in the limited tooltip box VS Code will draw).
What may complicated this is knowing where the docs are (eg. Flutter, Dart, and pub package docs may be in different places, and there may be multiple versions).
@bwilkerson does this server currently have enough info to be able to provide a URL in a hover request?
changed the title [-][Enhancement?] Popup tooltip should allow click to navigate to online doc[/-][+]Popup tooltip should allow click to navigate to online doc[/+]on Apr 1, 2019
does this server currently have enough info to be able to provide a URL in a hover request?
I'm not sure what information it needs.
It could certainly special case the SDK and Flutter docs.
For local docs, it could check for the existence of a doc/api directory and use that as the base from which to build a URL.
For other packages, is there a standard place to host docs? It looks like pub will download anything in the doc directory, but from what I looked at very few packages appear to include an api subdirectory containing their docs.
Though I don't know if there's a good way to tell if they exist (spawning a browser with a 404 wouldn't be ideal). I'm also not sure if the SDK docs have similar versioning if you'd always end up on the latest version (which isn't the end of the world, but could be a little confusing).
To serve from local folders would need a web server, so that might complicate things (though it's probably less important than others - probably if you want docs it's for other peoples code rather than your own).
Will be huge time saver and reduce the learning curve especially for packages like Flutter. The tooltip is great, but sparse with details on the parameters. I would not worry about local packages docs.
Is it mainly parameter info you're interested in? Can you give an example of something where the docs give more info than you're seeing in the tooltips? I expected that we'd show the same docs there.
It's not just parameters. It's mainly descriptions of methods, implementors constructors etc. E.g. Would be nice to navigate to DateTime class. It has so many ways of manipulating dates. Flutter framework classes are even more complex and unfamiliar, so open doc in the browser makes sense.
I wonder if there's enough value in just special casing the Dart/Flutter SDKs even without supporting this for arbitrary packages? I can't find a way to view the API docs for specific SDK versions though, it seems like https://api.flutter.dev/ is always latest stable. I don't know if it would be reasonable to always link to stable docs regardless of the version you're using (I suspect we can't easily even tell if the version you're using matches the version on the web without scraping the page for a version either).
(cc @srawlins since you see to be the most active dartdoc contributor recently)
From the issue above:
I just realized that the @youtube macro is already replaced by a YouTube link. It would be handy if something similar can be done to {@tool dartpad} and others. A link to the web docs there would be ideal.
This sounds useful, although I wonder if we should try to make some of these things first-class dartdoc macros instead of generic tool macros, since relying on behaviour of something defined outside of dartdoc feels a little awkward.
in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
Activity
DanTup commentedon Apr 1, 2019
I'm not sure exactly what you meany by "popup tooltip", but I think having some to jump to online docs for an item is reasonable (since it's often more readable there - esp. with DartDoc replacements - than in the limited tooltip box VS Code will draw).
What may complicated this is knowing where the docs are (eg. Flutter, Dart, and pub package docs may be in different places, and there may be multiple versions).
@bwilkerson does this server currently have enough info to be able to provide a URL in a hover request?
[-][Enhancement?] Popup tooltip should allow click to navigate to online doc[/-][+]Popup tooltip should allow click to navigate to online doc[/+]bwilkerson commentedon Apr 1, 2019
I'm not sure what information it needs.
doc/apidirectory and use that as the base from which to build a URL.docdirectory, but from what I looked at very few packages appear to include anapisubdirectory containing their docs.DanTup commentedon Apr 1, 2019
I saw there were Documentation links against each version on pub:
https://pub.dartlang.org/packages/devtools#-versions-tab-
Though I don't know if there's a good way to tell if they exist (spawning a browser with a 404 wouldn't be ideal). I'm also not sure if the SDK docs have similar versioning if you'd always end up on the latest version (which isn't the end of the world, but could be a little confusing).
To serve from local folders would need a web server, so that might complicate things (though it's probably less important than others - probably if you want docs it's for other peoples code rather than your own).
wyattbiker commentedon Apr 1, 2019
Will be huge time saver and reduce the learning curve especially for packages like Flutter. The tooltip is great, but sparse with details on the parameters. I would not worry about local packages docs.
DanTup commentedon Apr 8, 2019
Is it mainly parameter info you're interested in? Can you give an example of something where the docs give more info than you're seeing in the tooltips? I expected that we'd show the same docs there.
wyattbiker commentedon Apr 9, 2019
It's not just parameters. It's mainly descriptions of methods, implementors constructors etc. E.g. Would be nice to navigate to DateTime class. It has so many ways of manipulating dates. Flutter framework classes are even more complex and unfamiliar, so open doc in the browser makes sense.
(I just remembered Visual Studio for Unity https://docs.microsoft.com/en-us/visualstudio/cross-platform/using-visual-studio-tools-for-unity?view=vs-2019#keyboard-shortcuts )
DanTup commentedon Oct 16, 2023
This came up at #4793.
I wonder if there's enough value in just special casing the Dart/Flutter SDKs even without supporting this for arbitrary packages? I can't find a way to view the API docs for specific SDK versions though, it seems like https://api.flutter.dev/ is always latest stable. I don't know if it would be reasonable to always link to stable docs regardless of the version you're using (I suspect we can't easily even tell if the version you're using matches the version on the web without scraping the page for a version either).
(cc @srawlins since you see to be the most active dartdoc contributor recently)
From the issue above:
This sounds useful, although I wonder if we should try to make some of these things first-class dartdoc macros instead of generic tool macros, since relying on behaviour of something defined outside of dartdoc feels a little awkward.