From 48fa1f8ba0bfe721bae081b56b1d32586f711fe4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 25 Oct 2018 11:01:37 +0300 Subject: More informative lable for check runnable --- crates/ra_lsp_server/src/main_loop/handlers.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crates') 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( res.push(r); } let mut check_args = vec!["check".to_string()]; + let label; match CargoTargetSpec::for_file(&world, file_id)? { - Some(spec) => spec.push_to(&mut check_args), - None => check_args.push("--all".to_string()), + Some(spec) => { + label = format!("cargo check -p {}", spec.package); + spec.push_to(&mut check_args); + } + None => { + label = "cargo check --all".to_string(); + check_args.push("--all".to_string()) + } } // Always add `cargo check`. res.push(req::Runnable { range: Default::default(), - label: "cargo check".to_string(), + label, bin: "cargo".to_string(), args: check_args, env: FxHashMap::default(), -- cgit v1.2.3