use either::Either;
+use ide_db::helpers::node_ext::walk_ty;
use itertools::Itertools;
use syntax::{
- ast::{self, edit::IndentLevel, AstNode, GenericParamsOwner, NameOwner},
+ ast::{self, edit::IndentLevel, AstNode, HasGenericParams, HasName},
match_ast,
};
// }
// ```
pub(crate) fn extract_type_alias(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
- if ctx.frange.range.is_empty() {
+ if ctx.has_empty_selection() {
return None;
}
}
let mut generics = Vec::new();
- ty.walk(&mut |ty| match ty {
+ walk_ty(ty, &mut |ty| match ty {
ast::Type::PathType(ty) => {
if let Some(path) = ty.path() {
if let Some(name_ref) = path.as_single_name_ref() {