fix: rewrite code_action generate_delegate_trait

This commit is contained in:
roife 2023-12-13 11:22:42 +08:00
parent 19387d3077
commit 59aa791fe6
8 changed files with 983 additions and 158 deletions

View file

@ -572,6 +572,16 @@ impl ast::Item {
}
}
impl ast::Type {
pub fn generic_arg_list(&self) -> Option<ast::GenericArgList> {
if let ast::Type::PathType(path_type) = self {
path_type.path()?.segment()?.generic_arg_list()
} else {
None
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum FieldKind {
Name(ast::NameRef),