@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
throws CoreException, OperationCanceledException
{
RefactoringStatus status = super.checkInitialConditions(pm);
if (!status.isOK())
{
return status;
}
DeclarationType type = targetNode.getDeclaratonType();
HaxeTree searchScope = null;
switch (type)
{
case FunctionParameter:
searchScope = TreeUtils.getParentFunction(targetNode);
break;
case VarDeclaration:
searchScope = TreeUtils.getParentFunction(targetNode);
searchScope = ((Function)searchScope).getBlockScope();
break;
default:
searchScope = TreeUtils.getParentType(targetNode);
break;
}
if (TreeUtils.haveErrorNodes(searchScope))
{
return RefactoringStatus.createErrorStatus(
"There are parsing errors. Rename couldn't be processed.");
}
return new RefactoringStatus();
}