use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.
the class ErlideContextAssist method getVariables.
public Collection<String> getVariables(final String src, final String prefix) {
final SortedSet<String> result = new TreeSet<>();
try {
final OtpErlangObject res = backend.call("erlide_content_assist", "get_variables", "ss", src, prefix);
if (Util.isOk(res)) {
final OtpErlangTuple t = (OtpErlangTuple) res;
final OtpErlangList l = (OtpErlangList) t.elementAt(1);
for (final OtpErlangObject i : l) {
result.add(Util.stringValue(i));
}
}
} catch (final RpcException e) {
ErlLogger.error(e);
}
return result;
}
use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.
the class ErlideDoc method getModules.
@Override
public OtpErlangObject getModules(final IOtpRpc b, final String prefix, final List<String> projectModules, final boolean includes) {
OtpErlangObject res = null;
try {
final String what = includes ? "includes" : "modules";
res = b.call(ErlideDoc.ERLIDE_OTP_DOC, "get_modules", "slsa", prefix, projectModules, what);
} catch (final RpcException e) {
ErlLogger.warn(e);
}
return res;
}
use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.
the class ErlideDoc method getOtpDoc.
@Override
public OtpErlangObject getOtpDoc(final IOtpRpc b, final ErlangFunctionCall functionCall) {
OtpErlangObject res = null;
final OtpErlangTuple input = new OtpErlangTuple(new OtpErlangObject[] { new OtpErlangAtom("external"), new OtpErlangAtom(functionCall.getModule()), new OtpErlangAtom(functionCall.getName()), new OtpErlangInt(functionCall.getArity()), new OtpErlangString("") });
try {
res = b.call(ErlideDoc.ERLIDE_OTP_DOC, "get_doc", "sxs", functionCall.getModule(), input, stateDir);
} catch (final RpcException e) {
ErlLogger.warn(e);
}
return res;
}
use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.
the class ErlideOpen method getLibFiles.
@Override
public List<String> getLibFiles(final String entry) {
try {
final OtpErlangObject res = ideBackend.call(ErlideOpen.ERLIDE_OPEN, "get_lib_files", "ss", entry, stateDir);
if (Util.isOk(res)) {
final OtpErlangTuple t = (OtpErlangTuple) res;
final OtpErlangList l = (OtpErlangList) t.elementAt(1);
final List<String> result = Lists.newArrayListWithCapacity(l.arity());
for (final OtpErlangObject o : l) {
result.add(Util.stringValue(o));
}
return result;
}
} catch (final RpcException e) {
ErlLogger.error(e);
}
return null;
}
use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.
the class ErlideXref method modules.
public static List<String> modules(final IOtpRpc backend) {
final List<String> result = new ArrayList<>();
try {
final OtpErlangObject res = backend.call(ErlideXref.ERLIDE_XREF, "modules", "");
if (Util.isOk(res)) {
final OtpErlangTuple t = (OtpErlangTuple) res;
final OtpErlangList l = (OtpErlangList) t.elementAt(1);
for (final OtpErlangObject i : l) {
if (i instanceof OtpErlangAtom) {
final OtpErlangAtom m = (OtpErlangAtom) i;
result.add(m.atomValue());
}
}
}
} catch (final RpcException e) {
ErlLogger.error(e);
}
return result;
}
Aggregations