Add stubs for type params and type aliases

This commit is contained in:
Zanie 2023-07-17 18:26:42 -05:00
parent 0d4f1d86ad
commit 35cc48a64c
5 changed files with 6 additions and 0 deletions

View File

@ -590,6 +590,7 @@ where
keywords, keywords,
decorator_list, decorator_list,
body, body,
type_params: _,
range: _, range: _,
}, },
) => { ) => {

View File

@ -225,6 +225,7 @@ fn function(
decorator_list: vec![], decorator_list: vec![],
returns: Some(Box::new(return_type)), returns: Some(Box::new(return_type)),
type_comment: None, type_comment: None,
type_params: vec![],
range: TextRange::default(), range: TextRange::default(),
}); });
return generator.stmt(&func); return generator.stmt(&func);
@ -237,6 +238,7 @@ fn function(
decorator_list: vec![], decorator_list: vec![],
returns: None, returns: None,
type_comment: None, type_comment: None,
type_params: vec![],
range: TextRange::default(), range: TextRange::default(),
}); });
generator.stmt(&func) generator.stmt(&func)

View File

@ -171,6 +171,7 @@ fn create_class_def_stmt(typename: &str, body: Vec<Stmt>, base_class: &Expr) ->
keywords: vec![], keywords: vec![],
body, body,
decorator_list: vec![], decorator_list: vec![],
type_params: vec![],
range: TextRange::default(), range: TextRange::default(),
} }
.into() .into()

View File

@ -128,6 +128,7 @@ fn create_class_def_stmt(
keywords, keywords,
body, body,
decorator_list: vec![], decorator_list: vec![],
type_params: vec![],
range: TextRange::default(), range: TextRange::default(),
} }
.into() .into()

View File

@ -42,6 +42,7 @@ impl FormatRule<Stmt, PyFormatContext<'_>> for FormatStmt {
Stmt::ClassDef(x) => x.format().fmt(f), Stmt::ClassDef(x) => x.format().fmt(f),
Stmt::Return(x) => x.format().fmt(f), Stmt::Return(x) => x.format().fmt(f),
Stmt::Delete(x) => x.format().fmt(f), Stmt::Delete(x) => x.format().fmt(f),
Stmt::TypeAlias(_) => todo!(),
Stmt::Assign(x) => x.format().fmt(f), Stmt::Assign(x) => x.format().fmt(f),
Stmt::AugAssign(x) => x.format().fmt(f), Stmt::AugAssign(x) => x.format().fmt(f),
Stmt::AnnAssign(x) => x.format().fmt(f), Stmt::AnnAssign(x) => x.format().fmt(f),