calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
pez 2021-04-14T04:50:59.462600Z

This could be a side effect from when we added an option to prevent unbalanced closing at quotes. I'll have a look.

seancorfield 2021-04-14T05:11:22.463100Z

And maybe I’m having that kind of day: my Canary builds of Microsoft Edge were also doing weird things, so I reported bugs to MS, then restarted to pick up a new version and the bugs all went away 👀

🙂 1
pez 2021-04-14T05:16:54.464700Z

Funny it only hit docstrings. Happy it got resolved! I was utterly without clues. 😀

seancorfield 2021-04-14T05:34:16.464900Z

So am I at this point :face_with_rolling_eyes:

Faris 2021-04-14T07:26:09.467300Z

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

pez 2021-04-14T09:21:50.469100Z

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

pez 2021-04-14T09:22:58.470100Z

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

Faris 2021-04-14T09:27:09.470800Z

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?

pez 2021-04-14T10:19:43.471900Z

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

pez 2021-04-14T10:20:46.472900Z

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

Faris 2021-04-15T07:38:02.494300Z

I see, thanks for the help @pez and @brandon.ringe!!

2
flowthing 2021-04-14T11:16:27.475800Z

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?

flowthing 2021-04-14T11:17:03.476600Z

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

pez 2021-04-14T11:42:00.477400Z

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

flowthing 2021-04-14T11:44:26.478500Z

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.

flowthing 2021-04-14T11:45:25.479400Z

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.

flowthing 2021-04-14T11:46:05.479800Z

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

Faris 2021-04-14T14:21:10.479900Z

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?

pez 2021-04-14T15:45:48.483300Z

I’m not sure. But I maybe you are running into the problem addressed here? https://clojurians.slack.com/archives/C0617A8PQ/p1618228902247400

pez 2021-04-14T15:47:05.483600Z

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

pez 2021-04-14T15:47:45.483900Z

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.

pez 2021-04-14T15:48:47.484900Z

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.

flowthing 2021-04-14T15:52:32.487Z

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!

pez 2021-04-14T15:57:21.488800Z

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: https://calva.io/luminus/

alefeans 2021-04-14T17:06:37.491400Z

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 ?

pez 2021-04-14T17:08:37.491900Z

There is no such option, @alefeans2

pez 2021-04-14T17:10:35.493200Z

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.

pez 2021-04-14T17:11:05.493700Z

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

bringe 2021-04-14T17:58:53.493800Z

@hewrin See this issue for info related to your question, and a possible solution. https://github.com/BetterThanTomorrow/calva/issues/1049