diff --git a/crates/project-model/src/project_json.rs b/crates/project-model/src/project_json.rs index 6938010cbd..cbbb95cc46 100644 --- a/crates/project-model/src/project_json.rs +++ b/crates/project-model/src/project_json.rs @@ -368,6 +368,9 @@ pub enum RunnableKind { /// Template for checking a target, emitting rustc JSON diagnostics. /// May include {label} which will get the label from the `build` section of a crate. Flycheck, + + /// For forwards-compatibility, i.e. old rust-analyzer binary with newer workspace discovery tools + Unknown, } #[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] @@ -478,6 +481,11 @@ pub enum RunnableKindData { Check, Run, TestOne, + + /// For forwards-compatibility, i.e. old rust-analyzer binary with newer workspace discovery tools + #[allow(unused)] + #[serde(other)] + Unknown, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] @@ -546,6 +554,7 @@ impl From for RunnableKind { RunnableKindData::Run => RunnableKind::Run, RunnableKindData::TestOne => RunnableKind::TestOne, RunnableKindData::Flycheck => RunnableKind::Flycheck, + RunnableKindData::Unknown => RunnableKind::Unknown, } } } diff --git a/crates/project-model/test_data/labeled-project.json b/crates/project-model/test_data/labeled-project.json index 50f66739cf..5c0e1f3397 100644 --- a/crates/project-model/test_data/labeled-project.json +++ b/crates/project-model/test_data/labeled-project.json @@ -26,6 +26,12 @@ "program": "$ROOT$custom-flychecker.sh", "args": ["{label}"], "cwd": "$ROOT$" + }, + { + "kind": "we-ignore-unknown-runnable-kinds-for-forwards-compatibility", + "program": "abc", + "args": ["{label}"], + "cwd": "$ROOT$" } ] }