feat: Add an assist for inlining type aliases

This intends to lead to a more useful assist to replace all users of an
alias with its definition.
This commit is contained in:
Steven Joruk 2022-03-01 13:03:51 +00:00
parent cdeb1b2c78
commit 5b712bd821
4 changed files with 746 additions and 0 deletions

View file

@ -764,6 +764,15 @@ impl ast::Meta {
}
}
impl ast::GenericArgList {
pub fn lifetime_args(&self) -> impl Iterator<Item = ast::LifetimeArg> {
self.generic_args().filter_map(|arg| match arg {
ast::GenericArg::LifetimeArg(it) => Some(it),
_ => None,
})
}
}
impl ast::GenericParamList {
pub fn lifetime_params(&self) -> impl Iterator<Item = ast::LifetimeParam> {
self.generic_params().filter_map(|param| match param {