Search in sources :

Example 1 with GoElseStatement

use of com.goide.psi.GoElseStatement in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoElseUnwrapper method doUnwrap.

@Override
protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException {
    GoElseStatement elseStatement = (GoElseStatement) element;
    GoIfStatement elseIf = elseStatement.getIfStatement();
    context.extractNewLine(elseStatement);
    if (elseIf != null) {
        context.extractElement(elseIf, elseStatement);
    }
    context.extractFromBlock(elseStatement.getBlock(), elseStatement);
    context.delete(elseStatement);
}
Also used : GoElseStatement(com.goide.psi.GoElseStatement) GoIfStatement(com.goide.psi.GoIfStatement)

Aggregations

GoElseStatement (com.goide.psi.GoElseStatement)1 GoIfStatement (com.goide.psi.GoIfStatement)1