From 05daa86634b41aa3f311a1ac0b02bf7fed7ed569 Mon Sep 17 00:00:00 2001 From: Jan Jansen Date: Thu, 27 Dec 2018 21:45:16 +0100 Subject: Make modules with tests runnable Fixes #154 --- crates/ra_lsp_server/src/main_loop/handlers.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 3b7a14a5c..1d93e8f4d 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -257,6 +257,7 @@ pub fn handle_runnables( range: runnable.range.conv_with(&line_index), label: match &runnable.kind { RunnableKind::Test { name } => format!("test {}", name), + RunnableKind::TestMod { path } => format!("test-mod {}", path), RunnableKind::Bin => "run binary".to_string(), }, bin: "cargo".to_string(), @@ -308,6 +309,15 @@ pub fn handle_runnables( res.push(name.to_string()); res.push("--nocapture".to_string()); } + RunnableKind::TestMod { path } => { + res.push("test".to_string()); + if let Some(spec) = spec { + spec.push_to(&mut res); + } + res.push("--".to_string()); + res.push(path.to_string()); + res.push("--nocapture".to_string()); + } RunnableKind::Bin => { res.push("run".to_string()); if let Some(spec) = spec { -- cgit v1.2.3