rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.26k stars 1.61k forks source link

Not working on relibc #5268

Open bjorn3 opened 4 years ago

bjorn3 commented 4 years ago

https://gitlab.redox-os.org/redox-os/relibc/

Relibc has an unusual structure: Inside the src dir there are multiple dirs which each contain a regular cargo project with Cargo.toml and src/lib.rs, but also a ./mod.rs, which is used from the top-level src/lib.rs. For these mod.rs ide features are not working.

matklad commented 4 years ago

Yeah, this does not work because we currently softly assume that modules can't point across crates (we used this to avoid checking each mod foo; in stdlib, when a user crates new file in src). The solution here is to put all of the crates into a single FileSet, (instead of creating a fileset per crate). At the moment, we infer file sets from Cargo.toml though, and don't have a way to override them.