use of org.erlide.runtime.rpc.RpcResult in project erlide_eclipse by erlang.
the class RefactoringHandler method checkWarningMessages.
/**
* Checks whether there is any warning messages, if yes displays a view,
* containg all of them.
*/
protected void checkWarningMessages() {
try {
final RpcResult res = WranglerBackendManager.getRefactoringBackend().getLoggedInfo();
if (res.isOk()) {
final OtpErlangObject resobj = res.getValue();
if (!resobj.equals(new OtpErlangList())) {
final OtpErlangList reslist = (OtpErlangList) resobj;
for (int i = 0; i < reslist.arity(); ++i) {
final OtpErlangTuple restuple = (OtpErlangTuple) reslist.elementAt(i);
final String formattedString = formatWarningString(OtpErlang.asString(restuple.elementAt(1)));
WarningViewManager.addWarningMessage(formattedString);
}
}
} else {
ErlLogger.error("Wrangler logging error:" + res);
}
} catch (final Exception e) {
ErlLogger.error(e);
}
}
use of org.erlide.runtime.rpc.RpcResult in project erlide_eclipse by erlang.
the class GlobalParameters method hasQuickCheck.
/**
* Checks if QuickCheck is installed in the current machine.
*
* @return true if QC is installed, else false
*/
public static boolean hasQuickCheck() {
if (GlobalParameters.isQCchecked) {
return GlobalParameters.hasQuickCheck;
}
final RpcResult res = Activator.getDefault().getBackend().call_noexception("code", "which", "a", "eqc");
if (!res.isOk()) {
return false;
}
if (res.getValue() instanceof OtpErlangString) {
GlobalParameters.hasQuickCheck = true;
GlobalParameters.isQCchecked = true;
} else {
GlobalParameters.isQCchecked = true;
GlobalParameters.hasQuickCheck = false;
}
return GlobalParameters.hasQuickCheck;
}
use of org.erlide.runtime.rpc.RpcResult in project erlide_eclipse by erlang.
the class RenameFunctionRefactoring method getDefaultValue.
@Override
public String getDefaultValue() {
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
if (sel == null) {
return "";
}
final RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser("get_fun_name_eclipse", "siixi", sel.getFilePath(), sel.getSelectionRange().getStartLine(), sel.getSelectionRange().getStartCol(), sel.getSearchPath(), GlobalParameters.getTabWidth());
if (res.getValue().getClass().equals(OtpErlangString.class)) {
return ((OtpErlangString) res.getValue()).stringValue();
}
return "";
}
use of org.erlide.runtime.rpc.RpcResult in project erlide_eclipse by erlang.
the class UserRefactoring method fetchParPrompts.
/**
* Fetch parameter prompts from the right callback module
*
* @param module
*/
public boolean fetchParPrompts() {
if (fetched) {
return true;
}
final RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser("input_par_prompts_eclipse", "s", callbackModule);
final OtpErlangList params = (OtpErlangList) ((OtpErlangTuple) res.getValue()).elementAt(1);
parPrompts.clear();
for (final OtpErlangObject obj : params.elements()) {
parPrompts.add(obj.toString().replace("\"", ""));
}
fetched = true;
return true;
}
use of org.erlide.runtime.rpc.RpcResult in project erlide_eclipse by erlang.
the class WranglerRefactoringBackend method callInspection.
/**
* Call an inspection function
*
* @param functionName
* function name
* @param signature
* signature
* @param parameters
* function parameters
* @return RpcResultImpl wrapped result
*/
public RpcResult callInspection(final String functionName, final String signature, final Object... parameters) {
ErlLogger.info("Wrangler inspection call: " + makeLogStr(functionName, parameters));
RpcResult res;
res = backend.call_noexception(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, WranglerRefactoringBackend.INSPECTION_MODULE, functionName, signature, parameters);
return res;
}
Aggregations