Hi! This is a sequel of What do you think about publishing `libstd` on crates.io?
Problem: IntelliJ Rust and Racer powered IDEs and editors all need source code of the standard library to provide completion and go to definition.
It’s not so easy to download standard library at the moment. First, you need to figure out the version of the compiler you are using. Then, you need to fetch the sources of standard library together with the sources of the compiler. And then you have to find the crates which constitute the standard library.
I see several ways of making this more robust:
- RFC 1133 – this is the long term solution. But it will take a while to accept and implement this. Besides, it solves a much bigger problem of building the standard library. Perhaps we can get away with a more modest approach?
- Download sources of the compiler/stdlib as part of
rustup update(issue). This does not solve the problem of discovering
stdlibstructure and will become obsolete once RFC 1133 or similar is implemented.
- Provide a build in
cargo where_is_my_stdlibcommand, which will download the correct standard library version and present info about it in the JSON format, like
cargo metadata. This solution will also pave the way for RFC 1133, because you’ll need to worry only about actually building stdlib, and not about fetching it. And perhaps we don’t want to download stdlib from
crates.iobecause it has somewhat unusual versioning.
- Like 3, but as an external command.
What do you think about options 3 and 4? Looks like they are can be implemented with a reasonably low amount of effort and don’t have huge backwards compatibility hazards.