use of org.erlide.wrangler.refactoring.backend.internal.WranglerRefactoringBackend in project erlide_eclipse by erlang.
the class DuplicateDetectionAction method callRefactoring.
@SuppressWarnings("boxing")
@Override
protected IResultParser callRefactoring() throws WranglerRpcParsingException, CoreException, IOException, WranglerWarningException {
String functionName;
RpcResult result;
// getting the path of the fragment
final String suffixPath = getSuffixPath();
ErlLogger.debug("Suffix binary at: " + suffixPath);
final WranglerRefactoringBackend backend = WranglerBackendManager.getRefactoringBackend();
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
if (onlyInfile) {
functionName = "duplicated_code_eclipse";
final OtpErlangString fp = new OtpErlangString(sel.getFilePath());
final OtpErlangString[] fpa = new OtpErlangString[1];
fpa[0] = fp;
final OtpErlangList fpl = new OtpErlangList(fpa);
result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, functionName, "xiiis", fpl, minToks, minClones, GlobalParameters.getTabWidth(), suffixPath);
} else {
functionName = "duplicated_code_eclipse";
result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, functionName, "xiiis", sel.getSearchPath(), minToks, minClones, GlobalParameters.getTabWidth(), suffixPath);
}
if (!result.isOk()) {
throw new WranglerRpcParsingException("Rpc error");
}
return new DuplicateDetectionParser(result.getValue());
}
use of org.erlide.wrangler.refactoring.backend.internal.WranglerRefactoringBackend in project erlide_eclipse by erlang.
the class SimilarDetectionAction method callRefactoring.
@Override
protected IResultParser callRefactoring() throws WranglerRpcParsingException, CoreException, IOException, WranglerWarningException {
final WranglerRefactoringBackend backend = WranglerBackendManager.getRefactoringBackend();
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
RpcResult result;
final String functionName = "sim_code_detection_eclipse";
if (onlyInFile) {
final OtpErlangString fp = new OtpErlangString(sel.getFilePath());
final OtpErlangString[] fpa = new OtpErlangString[1];
fpa[0] = fp;
final OtpErlangList fpl = new OtpErlangList(fpa);
result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, functionName, "xiiiidxi", fpl, minLen, minToks, minFreq, maxNewVars, simScore, sel.getSearchPath(), GlobalParameters.getTabWidth());
} else {
result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, functionName, "xiiiidxi", sel.getSearchPath(), minLen, minToks, minFreq, maxNewVars, simScore, sel.getSearchPath(), GlobalParameters.getTabWidth());
}
if (!result.isOk()) {
throw new WranglerRpcParsingException("Rpc error");
}
return new DuplicateDetectionParser(result.getValue());
}
use of org.erlide.wrangler.refactoring.backend.internal.WranglerRefactoringBackend in project erlide_eclipse by erlang.
the class SimilarSearchAction method callRefactoring.
@Override
protected IResultParser callRefactoring() throws WranglerRpcParsingException, CoreException, IOException, WranglerWarningException {
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
final WranglerRefactoringBackend backend = WranglerBackendManager.getRefactoringBackend();
RpcResult result = null;
String functionName;
if (onlyInFile) {
functionName = "simi_expr_search_in_buffer_eclipse";
} else {
functionName = "simi_expr_search_in_dirs_eclipse";
}
result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, functionName, "sxxxxi", sel.getFilePath(), sel.getSelectionRange().getStartPos(), sel.getSelectionRange().getEndPos(), new OtpErlangFloat(simScore), sel.getSearchPath(), GlobalParameters.getTabWidth());
if (result.isOk()) {
return new SimilarExpressionSearchParser(result.getValue());
}
throw new WranglerRpcParsingException("RPC error");
}
use of org.erlide.wrangler.refactoring.backend.internal.WranglerRefactoringBackend in project erlide_eclipse by erlang.
the class ExpressionSearchAction method callRefactoring.
@Override
protected IResultParser callRefactoring() throws WranglerRpcParsingException {
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
final WranglerRefactoringBackend backend = WranglerBackendManager.getRefactoringBackend();
final RpcResult result = backend.callWithoutParser(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, "expr_search_eclipse", "sxxi", sel.getFilePath(), sel.getSelectionRange().getStartPos(), sel.getSelectionRange().getEndPos(), GlobalParameters.getTabWidth());
if (result.isOk()) {
return new ExpressionSearchParser(result.getValue());
}
throw new WranglerRpcParsingException("RPC error");
}
Aggregations