Fork me on GitHub

Hi everyone, I have a question about something I read in the docs

Most importantly, make sure you have cider/cider-nrepl as a dependency, and cider.nrepl/cider-middleware as middleware loaded in your REPL
How do I check for cider-middleware? I’m not jacking in from Calva straight, I use the Connect to a running REPL server in the project command


@hewrin you can use the command Copy Jack-in Command to Clipboard to see how Calva starts the REPL. Then you can either start it in a similar way (I would, if the setup allows) or place those dependencies in your project.


Note to self: We should update the docs you refer to with info about this command.


I got this from the Copy Jack-in Command

lein update-in :dependencies conj '[nrepl,"0.8.3"] '-- update-in :plugins conj '[cider/cider-nrepl,"0.25.10"] '-- update-in '[:repl-options,:nrepl-middleware] 'conj '["cider.nrepl/cider-middleware"] '-- with-profile +dev repl :headless
This means I have cider-middleware right?


It means you inject cider-middleware, but yes. 😃


Do you have any reasons to suspect you don’t have it? (Just curious about what got you to ask this.)


Earlier debugging didn’t seem to work for me, but I think its because I ran the code that called the function I was trying to instrument from the browser and not sending it to the REPL, does the debugger only work when using it with the REPL?


I’m not sure. But I maybe you are running into the problem addressed here?


You can try with that cider-nrepl version at least, and see if it works.


@hewrin See this issue for info related to your question, and a possible solution.


I see, thanks for the help @U0ETXRFEW and @U9A1RLFNV!!

calva 6

I’m helping out a colleague getting started with Calva. The project uses Leiningen and shadow-cljs. I run “Connect to a Running REPL Server in the project”, start the web app, open it in the browser to establish the JS runtime, then run (shadow.cljs.devtools.api/repl :app). Then, if I try evaluating something from a ClojureScript buffer, nothing happens. I think Calva does not recognize that I’m in a ClojureScript buffer or some reason or something. What am I doing wrong?


The status bar says “nREPL <lightning emoji> clj”, not “cljs”, even though I have a ClojureScript file open.


@flowthing When you connect, do you get to select a project type? Calva needs to know that cljs is involved.


Yeah, I chose Leiningen, because if I choose Leiningen + shadow-cljs, I get this:

; Execution error (ExceptionInfo) at shadow.cljs.devtools.server.runtime/get-instance! (runtime.clj:11).
shadow-cljs has not been started yet!
In embedded mode you need to call (shadow.cljs.devtools.server/start!) to start it.


I do understand what that error means, but I'm not sure how to set up Calva such that I don't get that error and I get a ClojureScript REPL.


I suppose I could set up the project differently somehow, but I'd like it if I didn't have to do that.


I haven’t seen that error before… Full stack projects can be a bit troublesome to get going. I can think of two things to try: 1. For full stack: Use the lein-shadow plugin and then jack-in/connect to that project type. 2. ClojureScript only: Configure shadow-cljs to use leiningen for dependencies and select the shadow-cljs project type.


If you have some time right now, @flowthing, I can make a video call and we might be able to figure something out via screen sharing.


Thanks for the offer! Can’t do it right now (and I probably wouldn’t be allowed to), but I’ll give the pointers you gave me a try. Thanks!


Maybe it can help creating a Luminus project configured for Leinginen + shadow-cljs and see how it is wired. Last time I checked that, it worked well with Calva. There’s a video and some instructions here:


I think i've asked this before, but just to check this again: isn't there any way to only show the evaluation results on the output.calva-repl window ?


There is no such option, @alefeans2


Wait. Maybe there is now. You can create custom command snippets that evaluate the current or top level forms, and bind those commands to the keys you want.


It will echo the evaluated form to the output window, though.