use of com.ericsson.otp.erlang.OtpErlangRangeException in project erlide_eclipse by erlang.
the class StateDataToRecordRpcMessage method parseRefactoringMessage.
@Override
protected void parseRefactoringMessage(final OtpErlangTuple resultTuple) throws WranglerException {
final OtpErlangObject wranglerResult = resultTuple.elementAt(1);
if (!"ok".equals(resultTuple.elementAt(0).toString())) {
final OtpErlangString msg = (OtpErlangString) wranglerResult;
setUnsuccessful(msg.stringValue());
} else {
if ("non_tuple".equals(wranglerResult.toString())) {
fieldCount = 1;
} else {
try {
fieldCount = ((OtpErlangLong) ((OtpErlangTuple) wranglerResult).elementAt(1)).intValue();
} catch (final OtpErlangRangeException e) {
throw new WranglerException(e.getMessage());
}
}
stateFuns = resultTuple.elementAt(2);
setSuccessful();
}
}
use of com.ericsson.otp.erlang.OtpErlangRangeException in project erlide_eclipse by erlang.
the class ErlangCompletionService method addOffsetsAndLengths.
void addOffsetsAndLengths(final OtpErlangList parOffsets, final int replacementOffset, final List<Location> result) {
for (final OtpErlangObject i : parOffsets) {
final OtpErlangTuple t = (OtpErlangTuple) i;
final OtpErlangLong offset = (OtpErlangLong) t.elementAt(0);
final OtpErlangLong length = (OtpErlangLong) t.elementAt(1);
try {
result.add(new Location(offset.intValue() + replacementOffset, length.intValue()));
} catch (final OtpErlangRangeException e) {
}
}
}
use of com.ericsson.otp.erlang.OtpErlangRangeException in project erlide_eclipse by erlang.
the class ErlideContextAssist method checkRecordCompletion.
public RecordCompletion checkRecordCompletion(final IOtpRpc buildBackend, final String prefix) {
try {
final OtpErlangObject res = buildBackend.call("erlide_content_assist", "check_record", "s", prefix);
if (Util.isOk(res)) {
final OtpErlangTuple t = (OtpErlangTuple) res;
final OtpErlangTuple r = (OtpErlangTuple) t.elementAt(1);
return new RecordCompletion(r);
}
} catch (final RpcException e) {
ErlLogger.error(e);
} catch (final OtpErlangRangeException e) {
ErlLogger.error(e);
}
return null;
}
Aggregations