Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide access to cargo's local index. #7824

Closed
Jezza opened this issue Jan 24, 2020 · 2 comments
Closed

Provide access to cargo's local index. #7824

Jezza opened this issue Jan 24, 2020 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@Jezza
Copy link

Jezza commented Jan 24, 2020

Describe the problem you are trying to solve
Intellij-Rust provides autocompletion for dependencies within Cargo.toml.
We have a pretty large performance problem, because as it stands now, we're just poking crates.io.
The network, of course, can add a lot of delay between typing and getting a response.

There is a plan to eventually utilise cargo's local index.

The reason I'm making this issue is because while I was reading up on how cargo implements its index, I discovered that it's a bit more involved because of a lot of technical problems that popped up.
(The index's and registry's documentation colours a nice picture)

At best, I'd like to avoid having to implement most of that code again, and just use cargo as the middleman.
That way if cargo changes the index for whatever reason, it'll still be accessible.

Describe the solution you'd like
The best solution would be to offer access to this index.
Ideally, cargo search already comes pretty close, it just doesn't support offline mode.
I'd be happy to try to implement that in cargo, but I'd like to see what people's opinions are.

I can't think of any other solutions specific to cargo.
If it's determine that it's too unstable, unreliable, or even extra maintenance work that isn't worth it, I'm fine manually implementing the code necessary to query the local index.

Notes
There are some external 3rd party commands that come close to doing what we would need, but getting people to install extra programs so their autocomplete works a bit better is a bit on the nose...

@Jezza Jezza added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 24, 2020
@ehuss
Copy link
Contributor

ehuss commented Feb 3, 2020

Having better access to the index sounds useful, but I'd be concerned that it assumes Cargo has access to the entire index. Initiatives like rust-lang/rfcs#2789 could change it so that the entire index is not available locally, which wouldn't work so great for autocompletion. I'm not sure it would be such a good idea to add a command that locks in the assumption that the entire index is available locally.

Unfortunately I can't offhand think of a good solution. Are there autocomplete implementations for other tools similar to Cargo? Do they query a network server?

@epage
Copy link
Contributor

epage commented Nov 3, 2023

tame-index exists though it touches cargo's internal caches which I'm not too pleased with because we don't define those interactions.

#11034 suggests a command for interacting with this.

#10655 and #10656 are issues that also need the full list of packages with the sparse index, with the first having more details.

Closing in favor of #11034 as it has more discussion.

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

3 participants