Skip to content

Externally discover the source directories of dependencies? #1098

@patrickjm

Description

@patrickjm

Regarding racer-rust/racer#73

At the moment it is difficult to find the local source directories of a crate's dependencies after they have been fetched. It's easy to search Cargo's folder that holds the downloaded git repositories, but this gets awkward when there is no simple way to link these with the actual Cargo.toml you're working with because Cargo uses its own hash (rather than git's) in the build directory. Not to mention that not all dependencies are git.

A Cargo command to print the source root of a dependency would greatly help the state of Rust's autocompletion (and probably tooling in general). cargo print-source-root was suggested.

Alternatively, these source directories could be printed along with the other json in cargo read-manifest, which actually seems more appropriate to me...

How feasible is this? Is there some simple internal cargo fn that I'm not seeing that could be exposed?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-new-subcommandArea: new subcommandA-toolingArea: interaction with other toolsP-highPriority: High

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions