static boolean tryFlip(PsiElement left, PsiElement right) { final Language language = left.getLanguage(); for (Flipper handler : EXTENSION.allForLanguage(language)) { if (handler.flip(left, right)) { return true; } } return false; }
private static void swapAtComma(@NotNull PsiElement comma) { PsiElement prev = smartAdvance(comma, false); PsiElement next = smartAdvance(comma, true); if (prev != null && next != null) { if (Flipper.tryFlip(prev, next)) { return; } PsiElement copy = prev.copy(); prev.replace(next); next.replace(copy); } }