Change Runnable.bin -> Runnable.kind

As per matklad, we now pass the responsibility for finding the binary to the frontend.
Also, added caching for finding the binary path to reduce
the amount of filesystem interactions.
This commit is contained in:
veetaha
2020-05-31 05:13:08 +03:00
parent a419cedb1c
commit d605ec9c32
13 changed files with 133 additions and 93 deletions

View File

@@ -121,12 +121,21 @@ pub struct RunnablesParams {
pub position: Option<Position>,
}
// Must strictly correspond to the executable name
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum RunnableKind {
Cargo,
Rustc,
Rustup,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Runnable {
pub range: Range,
pub label: String,
pub bin: String,
pub kind: RunnableKind,
pub args: Vec<String>,
pub extra_args: Vec<String>,
pub env: FxHashMap<String, String>,