use of com.perl5.lang.perl.psi.PerlCastExpression in project Perl5-IDEA by Camelcade.
the class PerlFormattingSimpleDereferenceUnwrap method apply.
@Override
public int apply() {
int delta = 0;
if (myCastElement.isValid() && myVariableElement.isValid()) {
String newCode = getCode();
PerlFileImpl newFile = PerlElementFactory.createFile(myCastElement.getProject(), newCode);
PerlCastExpression newCastExpression = PsiTreeUtil.findChildOfType(newFile, PerlCastExpression.class);
if (newCastExpression != null) {
delta = new PerlFormattingReplace(myCastElement, newCastExpression).apply();
}
}
return delta;
}
Aggregations