use of org.jetbrains.plugins.groovy.lang.psi.api.statements.GrWhileStatement in project intellij-community by JetBrains.
the class WhileSurrounder method getSurroundSelectionRange.
@Override
protected TextRange getSurroundSelectionRange(GroovyPsiElement element) {
assert element instanceof GrWhileStatement;
GrCondition condition = ((GrWhileStatement) element).getCondition();
int endOffset = element.getTextRange().getEndOffset();
if (condition != null) {
endOffset = condition.getTextRange().getStartOffset();
condition.getParent().getNode().removeChild(condition.getNode());
}
return new TextRange(endOffset, endOffset);
}
Aggregations