Fork me on GitHub
#cider
<
2018-12-07
>
phil13:12:29

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

phil13:12:03

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

mseddon16:12:19

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?

mseddon16:12:40

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

rickmoynihan20:12:37

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?

rickmoynihan20:12:15

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

rickmoynihan22:12:53

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

rickmoynihan22:12:32

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

danielneal22:12:10

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

rickmoynihan22:12:41

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)})"})
         nrepl/response-values
         ))

rickmoynihan22:12:40

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

rickmoynihan22:12:56

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

jumar08:12:26

@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...

rickmoynihan08:12:31

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

rickmoynihan08:12:43

I’ve pushed where I got to, though it doesn’t quite work. I’ve updated the README.md 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
rickmoynihan08:12:26

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

rickmoynihan22:12:07

so I can actually do it from my real repl

rickmoynihan22:12:47

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]"

rickmoynihan22:12:52

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

danielneal22:12:25

Yeah i think that should do it

richiardiandrea22:12:51

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

rickmoynihan22:12:21

something else isn’t working now — debugging