diff options
author | Kirill Bulatov <[email protected]> | 2021-05-23 21:10:05 +0100 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2021-05-23 21:10:05 +0100 |
commit | 2ca2e24a39594762be80ac11247b231c13a4b2af (patch) | |
tree | 0e15cd6f80855da9de714cdfdcf85709a0ed8c77 /crates | |
parent | de090749d9643a8035135092e2546cd0ddb854a6 (diff) |
Do not add cargo target for detached files only project
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index aa12fd94b..f48210424 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -661,19 +661,28 @@ pub(crate) fn handle_runnables( | |||
661 | } | 661 | } |
662 | } | 662 | } |
663 | None => { | 663 | None => { |
664 | res.push(lsp_ext::Runnable { | 664 | if !snap.config.linked_projects().is_empty() |
665 | label: "cargo check --workspace".to_string(), | 665 | || !snap |
666 | location: None, | 666 | .config |
667 | kind: lsp_ext::RunnableKind::Cargo, | 667 | .discovered_projects |
668 | args: lsp_ext::CargoRunnable { | 668 | .as_ref() |
669 | workspace_root: None, | 669 | .map(|projects| projects.is_empty()) |
670 | override_cargo: config.override_cargo, | 670 | .unwrap_or(true) |
671 | cargo_args: vec!["check".to_string(), "--workspace".to_string()], | 671 | { |
672 | cargo_extra_args: config.cargo_extra_args, | 672 | res.push(lsp_ext::Runnable { |
673 | executable_args: Vec::new(), | 673 | label: "cargo check --workspace".to_string(), |
674 | expect_test: None, | 674 | location: None, |
675 | }, | 675 | kind: lsp_ext::RunnableKind::Cargo, |
676 | }); | 676 | args: lsp_ext::CargoRunnable { |
677 | workspace_root: None, | ||
678 | override_cargo: config.override_cargo, | ||
679 | cargo_args: vec!["check".to_string(), "--workspace".to_string()], | ||
680 | cargo_extra_args: config.cargo_extra_args, | ||
681 | executable_args: Vec::new(), | ||
682 | expect_test: None, | ||
683 | }, | ||
684 | }); | ||
685 | } | ||
677 | } | 686 | } |
678 | } | 687 | } |
679 | Ok(res) | 688 | Ok(res) |