Skip to content

Suggestion: Open pub.dev link from pubspec.yaml #2785

Closed

Description

@ened

Hope this is the right place for a suggestion.

It would be nice if the popup menu of a dependency in the pubspec.yaml has a option to open https://pub.dev/packages/<package> directly.

Screenshot 2020-09-11 at 11 55 11

Activity

  1. DanTup commented on Sep 14, 2020

    @DanTup
    Member

    I don't know if there's a good way to do this (all of the other items there apply to the whole file and are not dependant on the cursor position - which we don't have). Perhaps it could be done as a code action with an Info diagnostic. I'll have to try it out, though it would make sense to do in the LSP server so it's not lost in the migration (plus other clients would get it).

  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Sep 14, 2020
  3. added this to the On Deck milestone on Sep 14, 2020
  4. modified the milestones: On Deck, Backlog on May 24, 2021
  5. DanTup commented on Dec 15, 2021

    @DanTup
    Member

    Perhaps Hovers would be better - eg. a tooltip with some information about the package and a hyperlink in it?

  6. modified the milestones: Backlog, On Deck on Dec 15, 2021
  7. ened commented on Dec 15, 2021

    @ened
    ContributorAuthor

    Perhaps Hovers would be better - eg. a tooltip with some information about the package and a hyperlink in it?

    Personally I prefer keyboard shortcuts but that doesn't have to exclude your suggestion. :-)

  8. modified the milestones: On Deck, v3.62.0 on Feb 27, 2023
  9. 15 remaining items

  10. DanTup commented on Feb 13, 2025

    @DanTup
    Member

    Great, thanks! It's not actually the Dart-Code extension, but rather the Dart LSP server that lives in the Dart SDK. This way it'll work for all LSP clients that support DocumentLink (and as a bonus, it's written in Dart and can use the existing YAML parsing etc.).

    I've started on a change at https://dart-review.googlesource.com/c/sdk/+/409660

  11. DanTup commented on Feb 21, 2025

    @DanTup
    Member

    This was implemented in dart-lang/sdk@a31be9b. The change is in the Dart(/Flutter) SDK, so it'll show up in a future Dart/Flutter SDK release rather than a Dart-Code extension release.

  12. alex-medinsh commented on Mar 4, 2025

    @alex-medinsh

    Hi @DanTup!

    Is it supposed to be cmd+click on a Mac? I am not getting this behaviour after upgrading to the latest dart extension (3.106).

  13. FMorschel commented on Mar 4, 2025

    @FMorschel
    Contributor

    @RepliedSage11 what Dart version are you using? Is it the one that comes with Flutter stable? As you can see above, this will be released not in a new Dart-Code release but on a new Dart release (test it out on Flutter master, for example).

  14. alex-medinsh commented on Mar 4, 2025

    @alex-medinsh

    It is the Flutter stable version. Since this was a part of a stable dart extension release I assumed that this is available with latest stable dart.

    Switching to latest Flutter master, running pub get and reopening VS Code also didn't allow me to cmd+click on any dependency in pubspec.

  15. DanTup commented on Mar 4, 2025

    @DanTup
    Member

    @RepliedSage11 sorry for the confusion. This issue was included in the release notes under the heading "Features/Fixes Enabled with Future SDKs". I like to include them in the release notes since they're features that VS Code features may care about, but since the versions are shipped independently, I include them under a separate heading and try to make it clear that users of master/dev channels may be able to test them already (for significant features, I then include them again in the release notes after they ship in a stable SDK in the top section).

    Switching to latest Flutter master, running pub get and reopening VS Code also didn't allow me to cmd+click on any dependency in pubspec.

    Can you confirm which version of Flutter you have by hovering over the {} in the lower right status bar with the pubspec open (including the pubspec in the screenshot may help too, as there are some conditions for the links to appear - for example path/git dependencies are treated differently). Here's what I see with latest Flutter master:

    Image

    The underlined package names can be Ctrl+Clicked (I'm not certain if it's Cmd+Click on Mac, but if you hover over you should see text that tells you):

    Image

    The version of the Dart SDK that includes the change is 3.8.0-124.0.dev and the version included in the current latest Flutter master is 3.8.0-133.0.dev.

  16. alex-medinsh commented on Mar 4, 2025

    @alex-medinsh

    This issue was included in the release notes under the heading "Features/Fixes Enabled with Future SDKs".

    I apologise for being inattentive. I jumped straight to the changelog since you mentioned this change in another similar issue I have opened and missed the heading.

    Can you confirm which version of Flutter you have

    My Dart extension was set to use a particular version of Flutter in the settings, hence it wasn't changing when switching the project version. Everything is working as expected on the latest dart version.

    Sorry for wasting your time.

  17. FMorschel commented on Mar 4, 2025

    @FMorschel
    Contributor

    Everything is working as expected on the latest dart version.

    Great!

    Sorry for wasting your time.

    It's always best to ask so we can find bugs. Thanks for testing it out!

  18. DanTup commented on Mar 4, 2025

    @DanTup
    Member

    @RepliedSage11 not a problem, I'm glad you were able to get it working :-)

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 editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions