crates.nvim icon indicating copy to clipboard operation
crates.nvim copied to clipboard

feature: support private registries

Open mercxry opened this issue 2 years ago • 6 comments

Hello, I use a private registry for some crates at work, unfortunately this plugin is not able to fetch the crate versions from there.

Are there plans to support private registries?

Screen Shot 2023-02-03 at 15 05 44

mercxry avatar Feb 03 '23 14:02 mercxry

That sounds reasonable, I'll see what I can do

saecki avatar Feb 13 '23 13:02 saecki

Any updates? I'd be happy to take a look myself, if you're busy ^^

LeonKowarschickKenbun avatar Mar 01 '23 15:03 LeonKowarschickKenbun

Yeah, sorry I'm currently quite swamped, feel free

saecki avatar Mar 02 '23 18:03 saecki

Stumbled onto this plugin, it's awesome, but I also use a custom registry.

Having just found the plugin, it will take me a while to familiarise myself with the code, and make any changes. @LeonKowarschickKenbun Did you manage to take a look at all?

stvndall avatar May 10 '23 11:05 stvndall

Not yet, sadly

LeonKowarschickKenbun avatar May 10 '23 12:05 LeonKowarschickKenbun

Here are some thoughts as to how this could be implemented

  • First we have to parse the registry declaration in the toml module and store it on the Crate struct
  • Then we need to obtain the user defined registries
    • global ones stored in the user home
    • and local ones stored in the repository
    • they should probably be lazy loaded when fetching metadata, since this involves FS operations
  • Lastly we just pass the whole crate struct to the functions in the API module which decide where to fetch metadata from

saecki avatar May 12 '23 17:05 saecki