aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_lsp_server/src/cargo_target_spec.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/cargo_target_spec.rs b/crates/ra_lsp_server/src/cargo_target_spec.rs
index 56d3f0de4..e08cc30e2 100644
--- a/crates/ra_lsp_server/src/cargo_target_spec.rs
+++ b/crates/ra_lsp_server/src/cargo_target_spec.rs
@@ -54,14 +54,17 @@ pub(crate) fn runnable_args(
54 Ok(res) 54 Ok(res)
55} 55}
56 56
57pub struct CargoTargetSpec { 57pub(crate) struct CargoTargetSpec {
58 pub package: String, 58 pub(crate) package: String,
59 pub target: String, 59 pub(crate) target: String,
60 pub target_kind: TargetKind, 60 pub(crate) target_kind: TargetKind,
61} 61}
62 62
63impl CargoTargetSpec { 63impl CargoTargetSpec {
64 pub fn for_file(world: &WorldSnapshot, file_id: FileId) -> Result<Option<CargoTargetSpec>> { 64 pub(crate) fn for_file(
65 world: &WorldSnapshot,
66 file_id: FileId,
67 ) -> Result<Option<CargoTargetSpec>> {
65 let &crate_id = match world.analysis().crate_for(file_id)?.first() { 68 let &crate_id = match world.analysis().crate_for(file_id)?.first() {
66 Some(crate_id) => crate_id, 69 Some(crate_id) => crate_id,
67 None => return Ok(None), 70 None => return Ok(None),
@@ -82,7 +85,7 @@ impl CargoTargetSpec {
82 Ok(res) 85 Ok(res)
83 } 86 }
84 87
85 pub fn push_to(self, buf: &mut Vec<String>) { 88 pub(crate) fn push_to(self, buf: &mut Vec<String>) {
86 buf.push("--package".to_string()); 89 buf.push("--package".to_string());
87 buf.push(self.package); 90 buf.push(self.package);
88 match self.target_kind { 91 match self.target_kind {