use of org.erlide.wrangler.refactoring.selection.IErlMemberSelection 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.IErlMemberSelection in project erlide_eclipse by erlang.
the class MergeLetRefactoring 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_let_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.IErlMemberSelection in project erlide_eclipse by erlang.
the class QuickCheckStateRefactoring method checkInitialConditions.
@Override
public RefactoringStatus checkInitialConditions(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
// FIXME: what kind of preconditions do I need?
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
final StateDataToRecordRpcMessage message = runFirst(sel);
if (!message.isSuccessful()) {
return RefactoringStatus.createFatalErrorStatus(message.getMessageString());
}
fieldCount = message.getFieldCount();
stateFuns = message.getStateFuns();
return new RefactoringStatus();
}
use of org.erlide.wrangler.refactoring.selection.IErlMemberSelection in project erlide_eclipse by erlang.
the class RenameFunctionRefactoring method run.
@Override
public IRefactoringRpcMessage run(final IErlSelection selection) {
final IErlMemberSelection sel = (IErlMemberSelection) selection;
final IErlRange memberRange = sel.getSelectionRange();
return WranglerBackendManager.getRefactoringBackend().call("rename_fun_eclipse", "siisxi", sel.getFilePath(), memberRange.getStartLine(), memberRange.getStartCol(), userInput, sel.getSearchPath(), GlobalParameters.getTabWidth());
}
Aggregations