aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-12 15:52:28 +0100
committerAleksey Kladov <[email protected]>2020-08-12 15:52:28 +0100
commit8d34262956059aca7e6fded351a9299b3581a5cf (patch)
treed61e655acf03a8116f67f5a65bae4db15d0661df /crates
parent550d7fbe3cbf2af4a47fca6c9bbefaf798cd7b7b (diff)
Rename ra_toolchain -> toolchain
Diffstat (limited to 'crates')
-rw-r--r--crates/flycheck/Cargo.toml2
-rw-r--r--crates/flycheck/src/lib.rs2
-rw-r--r--crates/ra_proc_macro_srv/Cargo.toml2
-rw-r--r--crates/ra_proc_macro_srv/src/tests/utils.rs2
-rw-r--r--crates/ra_project_model/Cargo.toml2
-rw-r--r--crates/ra_project_model/src/cargo_workspace.rs4
-rw-r--r--crates/ra_project_model/src/lib.rs2
-rw-r--r--crates/ra_project_model/src/sysroot.rs4
-rw-r--r--crates/rust-analyzer/Cargo.toml2
-rw-r--r--crates/rust-analyzer/src/handlers.rs2
-rw-r--r--crates/toolchain/Cargo.toml (renamed from crates/ra_toolchain/Cargo.toml)8
-rw-r--r--crates/toolchain/src/lib.rs (renamed from crates/ra_toolchain/src/lib.rs)4
12 files changed, 17 insertions, 19 deletions
diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml
index ff8a1e568..acc72bc59 100644
--- a/crates/flycheck/Cargo.toml
+++ b/crates/flycheck/Cargo.toml
@@ -14,4 +14,4 @@ log = "0.4.8"
14cargo_metadata = "0.11.1" 14cargo_metadata = "0.11.1"
15serde_json = "1.0.48" 15serde_json = "1.0.48"
16jod-thread = "0.1.1" 16jod-thread = "0.1.1"
17ra_toolchain = { path = "../ra_toolchain" } 17toolchain = { path = "../toolchain" }
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index 31e14246d..16078d104 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -193,7 +193,7 @@ impl FlycheckActor {
193 extra_args, 193 extra_args,
194 features, 194 features,
195 } => { 195 } => {
196 let mut cmd = Command::new(ra_toolchain::cargo()); 196 let mut cmd = Command::new(toolchain::cargo());
197 cmd.arg(command); 197 cmd.arg(command);
198 cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]) 198 cmd.args(&["--workspace", "--message-format=json", "--manifest-path"])
199 .arg(self.workspace_root.join("Cargo.toml")); 199 .arg(self.workspace_root.join("Cargo.toml"));
diff --git a/crates/ra_proc_macro_srv/Cargo.toml b/crates/ra_proc_macro_srv/Cargo.toml
index a690cc044..1c25e7229 100644
--- a/crates/ra_proc_macro_srv/Cargo.toml
+++ b/crates/ra_proc_macro_srv/Cargo.toml
@@ -23,4 +23,4 @@ cargo_metadata = "0.11.1"
23difference = "2.0.0" 23difference = "2.0.0"
24# used as proc macro test target 24# used as proc macro test target
25serde_derive = "1.0.106" 25serde_derive = "1.0.106"
26ra_toolchain = { path = "../ra_toolchain" } 26toolchain = { path = "../toolchain" }
diff --git a/crates/ra_proc_macro_srv/src/tests/utils.rs b/crates/ra_proc_macro_srv/src/tests/utils.rs
index dcb00671f..1b6a0b6fb 100644
--- a/crates/ra_proc_macro_srv/src/tests/utils.rs
+++ b/crates/ra_proc_macro_srv/src/tests/utils.rs
@@ -12,7 +12,7 @@ mod fixtures {
12 12
13 // Use current project metadata to get the proc-macro dylib path 13 // Use current project metadata to get the proc-macro dylib path
14 pub fn dylib_path(crate_name: &str, version: &str) -> std::path::PathBuf { 14 pub fn dylib_path(crate_name: &str, version: &str) -> std::path::PathBuf {
15 let command = Command::new(ra_toolchain::cargo()) 15 let command = Command::new(toolchain::cargo())
16 .args(&["check", "--message-format", "json"]) 16 .args(&["check", "--message-format", "json"])
17 .output() 17 .output()
18 .unwrap() 18 .unwrap()
diff --git a/crates/ra_project_model/Cargo.toml b/crates/ra_project_model/Cargo.toml
index 27b1f5d33..171fe8626 100644
--- a/crates/ra_project_model/Cargo.toml
+++ b/crates/ra_project_model/Cargo.toml
@@ -17,7 +17,7 @@ cargo_metadata = "0.11.1"
17arena = { path = "../arena" } 17arena = { path = "../arena" }
18ra_cfg = { path = "../ra_cfg" } 18ra_cfg = { path = "../ra_cfg" }
19ra_db = { path = "../ra_db" } 19ra_db = { path = "../ra_db" }
20ra_toolchain = { path = "../ra_toolchain" } 20toolchain = { path = "../toolchain" }
21ra_proc_macro = { path = "../ra_proc_macro" } 21ra_proc_macro = { path = "../ra_proc_macro" }
22paths = { path = "../paths" } 22paths = { path = "../paths" }
23stdx = { path = "../stdx" } 23stdx = { path = "../stdx" }
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs
index a526d743d..abf8dca96 100644
--- a/crates/ra_project_model/src/cargo_workspace.rs
+++ b/crates/ra_project_model/src/cargo_workspace.rs
@@ -140,7 +140,7 @@ impl CargoWorkspace {
140 cargo_features: &CargoConfig, 140 cargo_features: &CargoConfig,
141 ) -> Result<CargoWorkspace> { 141 ) -> Result<CargoWorkspace> {
142 let mut meta = MetadataCommand::new(); 142 let mut meta = MetadataCommand::new();
143 meta.cargo_path(ra_toolchain::cargo()); 143 meta.cargo_path(toolchain::cargo());
144 meta.manifest_path(cargo_toml.to_path_buf()); 144 meta.manifest_path(cargo_toml.to_path_buf());
145 if cargo_features.all_features { 145 if cargo_features.all_features {
146 meta.features(CargoOpt::AllFeatures); 146 meta.features(CargoOpt::AllFeatures);
@@ -288,7 +288,7 @@ pub fn load_extern_resources(
288 cargo_toml: &Path, 288 cargo_toml: &Path,
289 cargo_features: &CargoConfig, 289 cargo_features: &CargoConfig,
290) -> Result<ExternResources> { 290) -> Result<ExternResources> {
291 let mut cmd = Command::new(ra_toolchain::cargo()); 291 let mut cmd = Command::new(toolchain::cargo());
292 cmd.args(&["check", "--message-format=json", "--manifest-path"]).arg(cargo_toml); 292 cmd.args(&["check", "--message-format=json", "--manifest-path"]).arg(cargo_toml);
293 if cargo_features.all_features { 293 if cargo_features.all_features {
294 cmd.arg("--all-features"); 294 cmd.arg("--all-features");
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs
index 300e75135..46f44910c 100644
--- a/crates/ra_project_model/src/lib.rs
+++ b/crates/ra_project_model/src/lib.rs
@@ -513,7 +513,7 @@ fn get_rustc_cfg_options(target: Option<&str>) -> Vec<CfgFlag> {
513 } 513 }
514 514
515 let rustc_cfgs = { 515 let rustc_cfgs = {
516 let mut cmd = Command::new(ra_toolchain::rustc()); 516 let mut cmd = Command::new(toolchain::rustc());
517 cmd.args(&["--print", "cfg", "-O"]); 517 cmd.args(&["--print", "cfg", "-O"]);
518 if let Some(target) = target { 518 if let Some(target) = target {
519 cmd.args(&["--target", target]); 519 cmd.args(&["--target", target]);
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs
index 6ef001769..8239797b6 100644
--- a/crates/ra_project_model/src/sysroot.rs
+++ b/crates/ra_project_model/src/sysroot.rs
@@ -101,13 +101,13 @@ fn get_or_install_rust_src(cargo_toml: &AbsPath) -> Result<AbsPathBuf> {
101 return Ok(path); 101 return Ok(path);
102 } 102 }
103 let current_dir = cargo_toml.parent().unwrap(); 103 let current_dir = cargo_toml.parent().unwrap();
104 let mut rustc = Command::new(ra_toolchain::rustc()); 104 let mut rustc = Command::new(toolchain::rustc());
105 rustc.current_dir(current_dir).args(&["--print", "sysroot"]); 105 rustc.current_dir(current_dir).args(&["--print", "sysroot"]);
106 let stdout = utf8_stdout(rustc)?; 106 let stdout = utf8_stdout(rustc)?;
107 let sysroot_path = AbsPath::assert(Path::new(stdout.trim())); 107 let sysroot_path = AbsPath::assert(Path::new(stdout.trim()));
108 let mut src = get_rust_src(sysroot_path); 108 let mut src = get_rust_src(sysroot_path);
109 if src.is_none() { 109 if src.is_none() {
110 let mut rustup = Command::new(ra_toolchain::rustup()); 110 let mut rustup = Command::new(toolchain::rustup());
111 rustup.current_dir(current_dir).args(&["component", "add", "rust-src"]); 111 rustup.current_dir(current_dir).args(&["component", "add", "rust-src"]);
112 utf8_stdout(rustup)?; 112 utf8_stdout(rustup)?;
113 src = get_rust_src(sysroot_path); 113 src = get_rust_src(sysroot_path);
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 9bc5cc631..3f70510fd 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -43,7 +43,7 @@ ra_text_edit = { path = "../ra_text_edit" }
43vfs = { path = "../vfs" } 43vfs = { path = "../vfs" }
44vfs-notify = { path = "../vfs-notify" } 44vfs-notify = { path = "../vfs-notify" }
45ra_cfg = { path = "../ra_cfg" } 45ra_cfg = { path = "../ra_cfg" }
46ra_toolchain = { path = "../ra_toolchain" } 46toolchain = { path = "../toolchain" }
47 47
48# This should only be used in CLI 48# This should only be used in CLI
49ra_db = { path = "../ra_db" } 49ra_db = { path = "../ra_db" }
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index d9b75eed4..07f4af3d3 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -692,7 +692,7 @@ pub(crate) fn handle_formatting(
692 692
693 let mut rustfmt = match &snap.config.rustfmt { 693 let mut rustfmt = match &snap.config.rustfmt {
694 RustfmtConfig::Rustfmt { extra_args } => { 694 RustfmtConfig::Rustfmt { extra_args } => {
695 let mut cmd = process::Command::new(ra_toolchain::rustfmt()); 695 let mut cmd = process::Command::new(toolchain::rustfmt());
696 cmd.args(extra_args); 696 cmd.args(extra_args);
697 if let Some(&crate_id) = crate_ids.first() { 697 if let Some(&crate_id) = crate_ids.first() {
698 // Assume all crates are in the same edition 698 // Assume all crates are in the same edition
diff --git a/crates/ra_toolchain/Cargo.toml b/crates/toolchain/Cargo.toml
index 84b748c0a..4856668f8 100644
--- a/crates/ra_toolchain/Cargo.toml
+++ b/crates/toolchain/Cargo.toml
@@ -1,9 +1,9 @@
1[package] 1[package]
2edition = "2018" 2name = "toolchain"
3name = "ra_toolchain" 3version = "0.0.0"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0" 4license = "MIT OR Apache-2.0"
5authors = ["rust-analyzer developers"]
6edition = "2018"
7 7
8[lib] 8[lib]
9doctest = false 9doctest = false
diff --git a/crates/ra_toolchain/src/lib.rs b/crates/toolchain/src/lib.rs
index 9916e52c4..3b6886f5b 100644
--- a/crates/ra_toolchain/src/lib.rs
+++ b/crates/toolchain/src/lib.rs
@@ -1,6 +1,4 @@
1//! This crate contains a single public function 1//! Discovery of `cargo` & `rustc` executables.
2//! [`get_path_for_executable`](fn.get_path_for_executable.html).
3//! See docs there for more information.
4use std::{env, iter, path::PathBuf}; 2use std::{env, iter, path::PathBuf};
5 3
6pub fn cargo() -> PathBuf { 4pub fn cargo() -> PathBuf {