diff options
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 9d7f4f9f1..4ac08e527 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -269,14 +269,21 @@ pub fn handle_runnables( | |||
269 | res.push(r); | 269 | res.push(r); |
270 | } | 270 | } |
271 | let mut check_args = vec!["check".to_string()]; | 271 | let mut check_args = vec!["check".to_string()]; |
272 | let label; | ||
272 | match CargoTargetSpec::for_file(&world, file_id)? { | 273 | match CargoTargetSpec::for_file(&world, file_id)? { |
273 | Some(spec) => spec.push_to(&mut check_args), | 274 | Some(spec) => { |
274 | None => check_args.push("--all".to_string()), | 275 | label = format!("cargo check -p {}", spec.package); |
276 | spec.push_to(&mut check_args); | ||
277 | } | ||
278 | None => { | ||
279 | label = "cargo check --all".to_string(); | ||
280 | check_args.push("--all".to_string()) | ||
281 | } | ||
275 | } | 282 | } |
276 | // Always add `cargo check`. | 283 | // Always add `cargo check`. |
277 | res.push(req::Runnable { | 284 | res.push(req::Runnable { |
278 | range: Default::default(), | 285 | range: Default::default(), |
279 | label: "cargo check".to_string(), | 286 | label, |
280 | bin: "cargo".to_string(), | 287 | bin: "cargo".to_string(), |
281 | args: check_args, | 288 | args: check_args, |
282 | env: FxHashMap::default(), | 289 | env: FxHashMap::default(), |