Skip to content

Add Dependency should trim package names #3735

@JCKodel

Description

@JCKodel

Describe the bug
Dart: Add Dependency and Dart: Add Dev Dependency don't find the package if there are spaces after the name of the packet, failing silently (it outputs that the package doesn't exist only in the output panel).

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://pub.dev/packages/awesome_select'
  2. Double click on the package name (awesome_select). Notice that the browser automatically selects the space after the package name (at least in Edge).
  3. Use the Dart: Add Dependency option and paste (it will paste with the trailing space)
  4. Package installation fails because it doesn't trim the spaces

Expected behavior
Automatically space trimming (to improve productivity: [F1], [Enter], [Ctrl+V], [Enter], we're done, fast fast)
Also, it would be nice a red toast telling me that package was not found.

Screenshots
image

There is really a space here >.< It should be on the version side, not on the title, but, nothing we can do to change the source.

Versions (please complete the following information):

  • VS Code version: 1.63.2
  • Dart extension version: 3.29.0
  • Dart/Flutter SDK version: 2.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is 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