rust/crates/rust-analyzer/src
bors[bot] ddccaecb79
Merge #6524
6524: Add support for loading rustc private crates r=matklad a=xldenis

This PR presents a solution to the problem of making`rustc_private` crates visible to `rust-analyzer`. 
Currently developers add dependencies to those crates behind a `cfg(NOT_A_TARGET)` target to prevent `cargo` from building them.
This solution is unsatisfactory since it requires modifying `Cargo.toml` and causes problems for collaboration or CI. 

The proposed solution suggested by @matklad is to allow users to give RA a path where the `rustc` sources could be found and then load that like a normal workspace. 

This PR implements this solution by adding a `rustcSource` configuration item and adding the cargo metadata to the crate graph if it is provided. 

------

I have no idea how this should be tested, or if this code is generally tested at all. I've locally run the extension with these changes and it correctly loads the relevant crates on a `rustc_private` project of mine. 

Co-authored-by: Xavier Denis <xldenis@gmail.com>
2020-11-12 17:55:32 +00:00
..
bin Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
cli Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
diagnostics Update tests 2020-11-12 11:19:26 +01:00
caps.rs Switch to upstream protocol for resolving code action 2020-11-10 18:48:46 +01:00
cargo_target_spec.rs Emit better #[cfg] diagnostics 2020-10-22 19:19:18 +02:00
cli.rs
config.rs Merge #6524 2020-11-12 17:55:32 +00:00
diagnostics.rs
dispatch.rs Respond with JSON-RPC error if we failed to deserialize request 2020-10-30 19:57:52 +01:00
document.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
from_proto.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
global_state.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
handlers.rs Switch to upstream protocol for resolving code action 2020-11-10 18:48:46 +01:00
lib.rs Respond with JSON-RPC error if we failed to deserialize request 2020-10-30 19:57:52 +01:00
line_endings.rs
lsp_ext.rs Switch to upstream protocol for resolving code action 2020-11-10 18:48:46 +01:00
lsp_utils.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
main_loop.rs Switch to upstream protocol for resolving code action 2020-11-10 18:48:46 +01:00
markdown.rs
reload.rs Add support for loading rustc private crates 2020-11-11 12:45:40 +01:00
request_metrics.rs
semantic_tokens.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
thread_pool.rs Improve prime_caches and display its progress 2020-10-12 13:35:01 +02:00
to_proto.rs Switch to upstream protocol for resolving code action 2020-11-10 18:48:46 +01:00