serayuzgur / crates

crates is an extension aims to help people to manage their dependencies for rust (crates.io & TOML).
https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates
MIT License
238 stars 36 forks source link

Support for multiple registries! #213

Open mingley opened 1 year ago

mingley commented 1 year ago

Is your feature request related to a problem? Please describe.

Some users operating in a theoretical enterprise environment might have both external and internal crate registries being utilized.

Currently the option in the plugin to modify the index server URL supports only one value.

image

Describe the solution you'd like Ideally this plugin supports a collection of index servers that can be checked against in parallel. Additional overhead could be reduced by matching against whatever registry value is provided in the crate manifest Cargo.toml for a given dependency.

For example, in a random Cargo.toml

[dependencies]
something_internal = { version = "0.2.3", registry = "internal" } // registry provided here, match on name
serde = { version = "1.0", features = ["derive"] } // no registry provided here, assume external

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

I haven't raised a lot of issues before so let me know if you need any more information, I could also work on this myself if you don't have the bandwidth for it! Let me know :)

Additional context

yanqd0 commented 1 year ago

I have the same development environment. Hope this requirement to be implemented soon.

pwnorbitals commented 1 year ago

Yes, interested too !

serayuzgur commented 1 year ago

Hi, @mingley thanks for the issue, I don't have the time right now but you are welcome. There is something that tickles my mind, performance. The solution you provided may prevent it but since it is an extension to cargo toml, I believe we have to document it briefly and we have to make it more verbose. For ex. we use # crates: disable-check for ignore dependency, you can take a look at that.

SVilgelm commented 9 months ago

I'm also interested in this feature, we use several dependencies from private registries, and it is a bit annoying, that the extension shows an error for those dependencies.

SVilgelm commented 9 months ago

And it would be great, if the extension can automatically pick the registries and overrides up from the .cargo/config.toml file