diff options
author | Jan Jansen <[email protected]> | 2018-12-27 20:45:16 +0000 |
---|---|---|
committer | Jan Jansen <[email protected]> | 2018-12-31 14:00:04 +0000 |
commit | 05daa86634b41aa3f311a1ac0b02bf7fed7ed569 (patch) | |
tree | b703cfe2fc7788631703141d9f4be63b0f5d7fe5 /crates/ra_lsp_server/src | |
parent | 690826871202c77326836a895a38532ebd83c54b (diff) |
Make modules with tests runnable
Fixes #154
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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( | |||
257 | range: runnable.range.conv_with(&line_index), | 257 | range: runnable.range.conv_with(&line_index), |
258 | label: match &runnable.kind { | 258 | label: match &runnable.kind { |
259 | RunnableKind::Test { name } => format!("test {}", name), | 259 | RunnableKind::Test { name } => format!("test {}", name), |
260 | RunnableKind::TestMod { path } => format!("test-mod {}", path), | ||
260 | RunnableKind::Bin => "run binary".to_string(), | 261 | RunnableKind::Bin => "run binary".to_string(), |
261 | }, | 262 | }, |
262 | bin: "cargo".to_string(), | 263 | bin: "cargo".to_string(), |
@@ -308,6 +309,15 @@ pub fn handle_runnables( | |||
308 | res.push(name.to_string()); | 309 | res.push(name.to_string()); |
309 | res.push("--nocapture".to_string()); | 310 | res.push("--nocapture".to_string()); |
310 | } | 311 | } |
312 | RunnableKind::TestMod { path } => { | ||
313 | res.push("test".to_string()); | ||
314 | if let Some(spec) = spec { | ||
315 | spec.push_to(&mut res); | ||
316 | } | ||
317 | res.push("--".to_string()); | ||
318 | res.push(path.to_string()); | ||
319 | res.push("--nocapture".to_string()); | ||
320 | } | ||
311 | RunnableKind::Bin => { | 321 | RunnableKind::Bin => { |
312 | res.push("run".to_string()); | 322 | res.push("run".to_string()); |
313 | if let Some(spec) = spec { | 323 | if let Some(spec) = spec { |