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
Suggestion: Open pub.dev link from pubspec.yaml #2785
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).
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.).
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.
@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).
@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:
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):
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.
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.
Activity
DanTup commentedon Sep 14, 2020
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).
DanTup commentedon Dec 15, 2021
Perhaps Hovers would be better - eg. a tooltip with some information about the package and a hyperlink in it?
ened commentedon Dec 15, 2021
Personally I prefer keyboard shortcuts but that doesn't have to exclude your suggestion. :-)
15 remaining items
DanTup commentedon Feb 13, 2025
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
[analysis_server] Provide DocumentLinks for packages in Pubspec.yaml
DanTup commentedon Feb 21, 2025
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.
alex-medinsh commentedon Mar 4, 2025
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).
FMorschel commentedon Mar 4, 2025
@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).
alex-medinsh commentedon Mar 4, 2025
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.
DanTup commentedon Mar 4, 2025
@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).
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 examplepath/gitdependencies are treated differently). Here's what I see with latest Flutter master: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):
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.
alex-medinsh commentedon Mar 4, 2025
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.
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.
FMorschel commentedon Mar 4, 2025
Great!
It's always best to ask so we can find bugs. Thanks for testing it out!
DanTup commentedon Mar 4, 2025
@RepliedSage11 not a problem, I'm glad you were able to get it working :-)