}
public Set<String> getAvailableOperations () throws IllegalStateException {
if (describeInfo == null) {
try {
Response r = safeToolConnection.send(10000, "op", "describe");
// working around the fact that nREPL < 0.2.0-beta9 does *not* send a
// :done status when an operation is unknown!
// TODO remove this and just check r.statuses() after we can assume usage
// of later versions of nREPL
Object status = ((Map<String, String>)r.seq().first()).get(Keyword.intern("status"));
if (clojure.lang.Util.equals(status, "unknown-op") || (status instanceof Collection &&
((Collection)status).contains("error"))) {
CCWPlugin.logError("Invalid response to \"describe\" request");
describeInfo = new HashMap();
} else {
describeInfo = r.combinedResponse();
}
} catch (Exception e) {
CCWPlugin.logError("Error while trying to obtain nrepl available operations", e);
describeInfo = new HashMap();
}