aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-11-12 17:55:32 +0000
committerGitHub <[email protected]>2020-11-12 17:55:32 +0000
commitddccaecb79246f0c2bffb0ef9614939ee9a25835 (patch)
tree6dd43dd27d4ba2ae1ea7f8c9c4ca81c160d31848 /editors/code
parentcf73b6851b4e8f80c170d1ba8912f3c27b816c34 (diff)
parent89ce6b6664c9451c3c6ab9446fcd40697c5b0267 (diff)
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 <[email protected]>
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/package.json8
1 files changed, 8 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index eccafccdd..6db78a99a 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -687,6 +687,14 @@
687 }, 687 },
688 "default": [], 688 "default": [],
689 "description": "Additional arguments to be passed to cargo for runnables such as tests or binaries.\nFor example, it may be '--release'" 689 "description": "Additional arguments to be passed to cargo for runnables such as tests or binaries.\nFor example, it may be '--release'"
690 },
691 "rust-analyzer.rustcSource": {
692 "type": [
693 "null",
694 "string"
695 ],
696 "default": null,
697 "description": "Path to the rust compiler sources, for usage in rustc_private projects."
690 } 698 }
691 } 699 }
692 }, 700 },