Skip to content

Popup tooltip should allow click to navigate to online doc #1571

Open

Description

@wyattbiker

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.

Thanks!

Activity

  1. DanTup commented on Apr 1, 2019

    @DanTup
    Member

    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?

  2. added this to the Backlog milestone on Apr 1, 2019
  3. added
    is enhancement
    in editor
    on Apr 1, 2019
  4. 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
  5. bwilkerson commented on Apr 1, 2019

    @bwilkerson

    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.
  6. DanTup commented on Apr 1, 2019

    @DanTup
    Member

    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).

  7. wyattbiker commented on Apr 1, 2019

    @wyattbiker
    Author

    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.

  8. DanTup commented on Apr 8, 2019

    @DanTup
    Member

    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.

  9. wyattbiker commented on Apr 9, 2019

    @wyattbiker
    Author

    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 )

  10. DanTup commented on Oct 16, 2023

    @DanTup
    Member

    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:

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editoris enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions