mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
internal: Move ide-assists codegen tests into an xtask codegen command
This commit is contained in:
parent
0ac05c0527
commit
03b02e6bd0
11 changed files with 273 additions and 29 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue