question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support URLs and paths in Add Dependency command

See original GitHub issue

I am using v3.27.2 of the extension and I searched for a similar issue but I didn’t find anything related.

Currently, the auto-completion about dependencies just works in pubspec.yaml but I think it can be better to add the dependencies in import (for tired guys can be the best solution).

At this time the process for using a package is: (expect its kind - local, hosted on pub server or as a dev dep)

  1. Adding dependencies in pubspec.yaml
  2. Runnin pub get to fetch the package and other related configs
  3. import it and use it

But I suggest a new way (I am not sure this feature can be implemented in extension or not let me know). For example, we want to add a dependency in the dependency section in pubspec.yaml what we should do is:

  1. import the package with this syntax import 'dep:<package_name | git_remote_repo | local/path/to/package>'; auto completion works as same logic as used in pubspec.yaml (with some modification)
  2. crtl + . click on fetch package
  3. then pub add <package_name> --<associated_switch> will run and do all configurations

Note: as dev dependency we can use import 'dev:<package_name | git_remote_repo | local/path/to/package>';

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
DanTupcommented, Nov 22, 2021

@EhsanAramide it’s not problem at all, I understand how things are. I’ll work on this for the next release - thank you for your effort in starting this though! 😃

2reactions
DanTupcommented, Nov 1, 2021

You’re welcome to have a go if you want 😃

The way I was thinking it would work is that we insert two new items in the picklist, one for URLs and one for paths. Select the path option would open the folder picker and let you browser to the folder, and picking URL would just give an input box that is validated as a URL. Then the results just get passed to pub add the same way the package name would.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding package dependencies to your app - Apple Developer
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL....
Read more >
Managing dependencies - The Go Programming Language
To track and manage the dependencies you add, you begin by putting your code in its own module. This creates a go.mod file...
Read more >
package.json - npm Docs
Users can use the npm fund subcommand to list the funding URLs of all dependencies of their project, direct and indirect. A shortcut...
Read more >
cargo add - The Cargo Book
This command can add or modify dependencies. The source for the dependency can be specified with: crate @ version: Fetch from a registry...
Read more >
Add build dependencies - Android Developers
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found