ddccaecb79
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> |
||
---|---|---|
.. | ||
bin | ||
cli | ||
diagnostics | ||
caps.rs | ||
cargo_target_spec.rs | ||
cli.rs | ||
config.rs | ||
diagnostics.rs | ||
dispatch.rs | ||
document.rs | ||
from_proto.rs | ||
global_state.rs | ||
handlers.rs | ||
lib.rs | ||
line_endings.rs | ||
lsp_ext.rs | ||
lsp_utils.rs | ||
main_loop.rs | ||
markdown.rs | ||
reload.rs | ||
request_metrics.rs | ||
semantic_tokens.rs | ||
thread_pool.rs | ||
to_proto.rs |