Exemple #1
0
    def prepare_payload(self, *args):
        if len(args) == 0:
            ns = path_to_ns(self.nvim)
            if ns is None:
                warning(
                    "Unable to require: couldn't find namespace from path.")
                return None
        else:
            ns = " ".join(args)

        return {"code": "(require '[{}] :reload)".format(ns)}
Exemple #2
0
    def gather_candidates(self, keyword):
        if not loaded:
            return []

        address = localhost(self._vim)
        if address is None:
            return []
        url = "nrepl://{}:{}".format(*address)
        wc = self.get_wc(url)
        session = self.get_session(url, wc)
        ns = path_to_ns(self._vim)

        def global_watch(cmsg, cwc, ckey):
            self._logger.debug("Received message for {}".format(url))
            self._logger.debug(cmsg)

        wc.watch('global_watch', {}, global_watch)

        return cider_gather(self._logger,
                            Acid_nrepl(wc),
                            keyword,
                            session,
                            ns)
Exemple #3
0
 def prepare_payload(self, data):
     return {"symbol": data, "ns": path_to_ns(self.nvim)}
Exemple #4
0
 def acid_require(self):
     data = "(require '[{} :refer :all])".format(path_to_ns(self.nvim))
     self.eval({"code": data}, "Ignore")