Fork me on GitHub

Hey. I've never managed to get the #break macro to work for me. Is there anything I might be missing?


Ah, works in another project - safe to assume user error.


I am doing some custom validation inside a macro. I know the file and line/column information of the error- is there a way to raise an exception in such a way that Cider can report the issue at the relevant position in the right buffer?


ah, I see clojure.lang.Compiler$CompilerException, which is working okay, but if there's a better class to use, I will.


Can someone clarify this from the nrepl docs for me: > :requires, a set containing strings or vars identifying other middleware that must be applied at a higher level than the middleware being described. Var references indicate an implementation detail dependency; string values indicate a dependency on any middleware that handles the specified :op. Does “higher level” here mean that :requires happen before the handler call?


ok further down it expands on the above — so looks like :requires are before


Ok I’ve figured out how to get REBL to spy on an nrepl connection


seems to work — but likely needs some more work… I need to properly test it


Awesome. I'm well up for having a go with something not fully tested :)


well I have a few more hoops to jump through… I’m currently testing it by starting a server in my cider repl with (def nrep (ser/start-server :port 55801 :handler (ser/default-handler #'wrap-nrebl))) and then sending forms to it via an nrepl client call:

(with-open [conn (nrepl/connect :port 55801)]
     (-> (nrepl/client conn 1000)    ; message receive timeout required
         ;(nrepl/message {:op "inspect-nrebl" :code "[1 2 3 4 5 6 7 8 9 10 {:a :stuck_out_tongue: :c :d :e #{5 6 7 8 9 10}}]"})
         (nrepl/message {:op "eval" :code "(do {:a :b: :c [1 2 3 4] :d #{5 6 7 8} :e (range 20)})"})


just tried sharing a screenshot — but there’s no storage left in this slack


anyway I need to figure out now how to run this middleware with cider


@U06HHF230 Do you know how to run this with leiningen based project and Emacs/Cider?. I tried to look around but not sure how to add nrepl middleware to my project...


I was trying to get that working last night — but ran into some issues that I haven’t resolved


I’ve pushed where I got to, though it doesn’t quite work. I’ve updated the with something close to what you’ll need in profiles.clj. Though it may be there are code changes needed too. You’ll also need to lein install nrebl.middleware from source.

👍 4

I’m out today — but if you can figure it out that would be amazing


so I can actually do it from my real repl


I think I need to modify this command to inject my middleware: clj -Sdeps '{:deps {nrepl {:mvn/version "0.4.5"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"


lol turns out I already have the incantation in my repl history… well done me of the past!


Yeah i think that should do it


can confirm that if you add a middleware in the first position of the vector above it should wrap the cider-middleware


something else isn’t working now — debugging