Add unknown runnable kind for forwards compatibility

This commit is contained in:
Cormac Relf
2026-01-09 10:06:47 +11:00
parent d8b74b7eb4
commit 2969b3bf57
2 changed files with 15 additions and 0 deletions

View File

@@ -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<RunnableKindData> for RunnableKind {
RunnableKindData::Run => RunnableKind::Run,
RunnableKindData::TestOne => RunnableKind::TestOne,
RunnableKindData::Flycheck => RunnableKind::Flycheck,
RunnableKindData::Unknown => RunnableKind::Unknown,
}
}
}

View File

@@ -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$"
}
]
}