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

Aliased crates in object format [dependencies.example] always report an error #185

Open chanced opened 1 year ago

chanced commented 1 year ago

Describe the bug When using an object notation [dependencies.example] with an aliased crate name, an error is displayed indicating that the version is not correct. If the condensed format is used, this works perfectly fine.

For example, this reports as having an invalid version:

[dependencies.rust-crypto-p256]
package = "p256"
version = "0.12"

while this works fine:

[dependencies]

rust-crypto-p256 = { package = "p256", version = "0.12" }

To Reproduce Steps to reproduce the behavior:

  1. cargo init example
  2. cd example
  3. edit Cargo.toml
  4. add:
    [dependecies.example]
    package = "serde"
    version = "1.0"

Expected behavior The format of the dependencies list should not matter when dealing with aliased dependencies.

Screenshots

works doesnt work

Desktop (please complete the following information):

chanced commented 1 year ago

To expand on this, one issue seems to be that the value of package is not being considered.

crates warns that this should be 0.13.2, which is the most recently published version of the random crate, not rand:

[dependencies.random]
package = "rand"
version = "0.8"
Screenshot 2023-02-03 at 5 05 55 PM