internal: Move ide-assists codegen tests into an xtask codegen command

This commit is contained in:
Lukas Wirth 2024-02-28 16:17:44 +01:00
parent 0ac05c0527
commit 03b02e6bd0
11 changed files with 273 additions and 29 deletions

View file

@ -52,6 +52,11 @@ xflags::xflags! {
cmd bb {
required suffix: String
}
cmd codegen {
optional codegen_type: CodegenType
optional --check
}
}
}
@ -73,8 +78,32 @@ pub enum XtaskCmd {
PublishReleaseNotes(PublishReleaseNotes),
Metrics(Metrics),
Bb(Bb),
Codegen(Codegen),
}
#[derive(Debug)]
pub struct Codegen {
pub check: bool,
pub codegen_type: Option<CodegenType>,
}
#[derive(Debug, Default)]
pub enum CodegenType {
#[default]
All,
AssistsDocTests,
}
impl FromStr for CodegenType {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"all" => Ok(Self::All),
"assists-doc-tests" => Ok(Self::AssistsDocTests),
_ => Err("Invalid option".to_owned()),
}
}
}
#[derive(Debug)]
pub struct Install {
pub client: bool,