void (@NotNull ActionContext context, @NotNull GrTypeDefinition typeDef, @NotNull ModPsiUpdater updater) { Set<String> classes = new LinkedHashSet<>(); Set<String> interfaces = new LinkedHashSet<>(); Set<String> unknownClasses = new LinkedHashSet<>(); Set<String> unknownInterfaces = new LinkedHashSet<>(); GrExtendsClause extendsClause = typeDef.getExtendsClause(); GrImplementsClause implementsClause = typeDef.getImplementsClause(); Project project = context.project(); if (extendsClause != null) { collectRefs(extendsClause.getReferenceElementsGroovy(), classes, interfaces, typeDef.isInterface() ? unknownInterfaces : unknownClasses); extendsClause.delete(); } if (implementsClause != null) { collectRefs(implementsClause.getReferenceElementsGroovy(), classes, interfaces, unknownInterfaces); implementsClause.delete(); } if (typeDef.isInterface()) { interfaces.addAll(classes); unknownInterfaces.addAll(unknownClasses); addNewClause(typeDef, interfaces, unknownInterfaces, project, true); } else { addNewClause(typeDef, classes, unknownClasses, project, true); addNewClause(typeDef, interfaces, unknownInterfaces, project, false); } }