aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock1
-rw-r--r--crates/ra_lsp_server/Cargo.toml1
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs2
-rw-r--r--crates/tools/src/lib.rs2
4 files changed, 5 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fa3363bd2..0c29d491f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -790,6 +790,7 @@ dependencies = [
790 "text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 790 "text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
791 "thread_worker 0.1.0", 791 "thread_worker 0.1.0",
792 "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", 792 "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
793 "tools 0.1.0",
793 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 794 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
794 "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", 795 "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
795] 796]
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index c53106a62..f8f91e5e7 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -33,6 +33,7 @@ ra_text_edit = { path = "../ra_text_edit" }
33ra_analysis = { path = "../ra_analysis" } 33ra_analysis = { path = "../ra_analysis" }
34gen_lsp_server = { path = "../gen_lsp_server" } 34gen_lsp_server = { path = "../gen_lsp_server" }
35ra_vfs = { path = "../ra_vfs" } 35ra_vfs = { path = "../ra_vfs" }
36tools = { path = "../tools" }
36 37
37[dev-dependencies] 38[dev-dependencies]
38tempdir = "0.3.7" 39tempdir = "0.3.7"
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index e9f02a6e4..b0e1e65b6 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -121,6 +121,8 @@ fn test_eggs() {}
121use std::collections::HashMap; 121use std::collections::HashMap;
122#[test] 122#[test]
123fn test_format_document() { 123fn test_format_document() {
124 tools::install_rustfmt().unwrap();
125
124 let server = project( 126 let server = project(
125 r#" 127 r#"
126[package] 128[package]
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs
index 6f96b8120..e5b32c25c 100644
--- a/crates/tools/src/lib.rs
+++ b/crates/tools/src/lib.rs
@@ -117,7 +117,7 @@ pub fn run_rustfmt(mode: Mode) -> Result<()> {
117 Ok(()) 117 Ok(())
118} 118}
119 119
120fn install_rustfmt() -> Result<()> { 120pub fn install_rustfmt() -> Result<()> {
121 run(&format!("rustup install {}", TOOLCHAIN), ".")?; 121 run(&format!("rustup install {}", TOOLCHAIN), ".")?;
122 run( 122 run(
123 &format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN), 123 &format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN),