Fork me on GitHub

Wasn't the context supposed to be just the containing form or something like this? Why would someone send the entire buffer?


It is. But searching for matching parens so you only send the outermost form is expensive. I was trying to find an alternative that would be faster to run.


Seems to me that's compliment-specific, though, as nREPL's own completion doesn't even have a notion of completion context currently.


How can I start an nrepl server in some main ns that catches errors in the main application thread? I'm not sure if that question makes sense, but say there's some UI or "game loop" that is continually running alongside the server, like this:

(ns my-app
  (:require [nrepl.server :as server]

(defonce server
    :port 7888
    :handler (apply nrepl.server/default-handler cider.nrepl/cider-middleware)))

(defn do-thing []
  (Thread/sleep 1000)
  (println (System/currentTimeMillis))
  ;; (inc nil)

(defn -main [& args]
  (loop []
instead of starting the nrepl server using -m nrepl.cmdline . I can then connect to the server with Cider and interactively redefine the do-thing function, but if it throws an error (eg. uncomment the (inc nil)), the entire process exits instead of triggering the stacktrace middleware.


Hmm, I never thought about this, so no answer immediately comes to mind. I assume the problem happens only for invocations that happen in -main right?


Might be a good idea to post this on the issue tracker, so we won't forget about it.