use of org.erlide.wrangler.refactoring.selection.IErlSelection in project erlide_eclipse by erlang.
the class FoldAgainstMacro method checkInitialConditions.
@Override
public RefactoringStatus checkInitialConditions(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
final IErlSelection selection = GlobalParameters.getWranglerSelection();
/*
* if (!((selection instanceof IErlMemberSelection) && (selection
* .getKind() == SelectionKind.FUNCTION || selection.getKind() ==
* SelectionKind.FUNCTION_CLAUSE))) return RefactoringStatus
* .createFatalErrorStatus("Please select an expression!");
*/
final IErlMemberSelection sel = (IErlMemberSelection) selection;
ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend().callWithParser(m, "fold_against_macro_eclipse", "siixi", sel.getFilePath(), sel.getMemberRange().getStartLine(), sel.getMemberRange().getStartCol(), sel.getSearchPath(), GlobalParameters.getTabWidth());
if (m.isSuccessful()) {
syntaxTree = m.getSyntaxTree();
positions = m.getPositionDefinitions(sel.getDocument());
selectedPositions = new ArrayList<>();
} else {
return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
}
return new RefactoringStatus();
}
use of org.erlide.wrangler.refactoring.selection.IErlSelection in project erlide_eclipse by erlang.
the class FoldLocalExpressionRefactoring method checkFinalConditions.
@Override
public RefactoringStatus checkFinalConditions(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
final IErlSelection sel = GlobalParameters.getWranglerSelection();
final IRefactoringRpcMessage message = run(sel);
if (message.isSuccessful()) {
changedFiles = message.getRefactoringChangeset();
return new RefactoringStatus();
}
return RefactoringStatus.createFatalErrorStatus(message.getMessageString());
}
use of org.erlide.wrangler.refactoring.selection.IErlSelection in project erlide_eclipse by erlang.
the class FoldRemoteExpressionRefactoring method checkFinalConditions.
@Override
public RefactoringStatus checkFinalConditions(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
final IErlSelection sel = GlobalParameters.getWranglerSelection();
final IRefactoringRpcMessage message = run(sel);
if (message.isSuccessful()) {
changedFiles = message.getRefactoringChangeset();
return new RefactoringStatus();
}
return RefactoringStatus.createFatalErrorStatus(message.getMessageString());
}
use of org.erlide.wrangler.refactoring.selection.IErlSelection in project erlide_eclipse by erlang.
the class MergeForAllRefactoring method checkInitialConditions.
@Override
public RefactoringStatus checkInitialConditions(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
final IErlSelection selection = GlobalParameters.getWranglerSelection();
/*
* if (!((selection instanceof IErlMemberSelection) && (selection
* .getKind() == SelectionKind.FUNCTION || selection.getKind() ==
* SelectionKind.FUNCTION_CLAUSE))) return RefactoringStatus
* .createFatalErrorStatus("Please select an expression!");
*/
final IErlMemberSelection sel = (IErlMemberSelection) selection;
ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend().callWithParser(m, "merge_forall_eclipse", "sxi", sel.getFilePath(), sel.getSearchPath(), GlobalParameters.getTabWidth());
if (m.isSuccessful()) {
positions = m.getPositionDefinitions(sel.getDocument());
selectedPositions = new ArrayList<>();
} else {
return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
}
return new RefactoringStatus();
}
use of org.erlide.wrangler.refactoring.selection.IErlSelection in project erlide_eclipse by erlang.
the class MergeLetRefactoring method checkFinalConditions.
@Override
public RefactoringStatus checkFinalConditions(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
final IErlSelection sel = GlobalParameters.getWranglerSelection();
final IRefactoringRpcMessage message = run(sel);
if (message.isSuccessful()) {
changedFiles = message.getRefactoringChangeset();
return new RefactoringStatus();
}
return RefactoringStatus.createFatalErrorStatus(message.getMessageString());
}
Aggregations