Fork me on GitHub
#calva
<
2019-02-01
>
mseddon13:02:41

It's been a long time cooking, but here is the beta release of the new Calva REPL! With code completion, automatic formatting, syntax highlighting and rich exception reporting. This is a significantly big addition to Calva, and we hope it will make the general day to day experience far more pleasant. This build has paredit built in- you may need to disable calva-paredit if the extension has trouble starting. To open a clojure/clojurescript repl once connected, use the "Open Clojure(Script) REPL Window" command. If you accidentally do something silly like try to (cycle '[infinite]), or have a runaway computation, Ctrl+D will interrupt it for you. To go up/down the history, use Alt+Up, Alt+Down. To force delete parenthesis when our new (repl only for now) paredit doesn't want to, use Alt+Backspace or Alt+Delete. Let us know how you get on, and what you think! All comments and feedback welcome!

guillaume13:02:01

does this mean we need to disable those…

mseddon13:02:25

Just calva paredit for now

mseddon13:02:47

the final release you won't need to do anything, but it may occasionally conflict with this preview

guillaume14:02:43

how does the automatic formatting relate to the calva clojure formatter?

mseddon14:02:22

it is a clone of that to a large extent, we will be integrating that so they share the exact same codebase shortly

mseddon14:02:57

the underlying text model used for the repl control is a (slightly) more advanced version of what calva-fmt uses currently.

pez14:02:05

Dear tester, A particular thing we you can keep an eye on when testing is that occasionally the REPL connection stops working when you close the CLJS REPL window. If you see any pattern to that madness, please let us know!

pez14:02:33

Chances are you do not need to disable Calva Paredit when testing the preview. VSCode disables it for me, at least. If you get a message about paredit failing to start, then things are all good. If you leave it enabled and don't get that message, please tell us.

mattly17:02:32

does this support connecting to the regular cider repl? it's only giving me figwheel as an option, my project has both clj and cljs via fighwheel

pez17:02:31

Yes, that is a bit unclear. Both connections are established and you can open both a CLJ and CLJS REPL window.

pez18:02:53

(So the Figwheel prompt is Calva’s way to tell you it has identified that the project includes a Figwheel conf and offers to connect to that repl.)

jeremy20:02:58

The new repl window is quite snazzy.

mseddon20:02:52

Thanks! 😀. I am trying to get a bit of a feel for the old symbolics lisp machines. Glad you are liking it.

jeremy20:02:08

@mseddon Where would you like issues logged?

mseddon20:02:10

@jeremy642 https://github.com/BetterThanTomorrow/calva/issues, thanks! There are still probably a few rough edges

mseddon20:02:04

Or click on the github link in the console welcome message. That should get you there too ;)

mseddon22:02:22

@all I refuse to believe I haven't riddled this update with bugs. Where are my issues? ;) thanks to all you brave souls trying it out!

jeremy22:02:55

Busy day at work. Haven’t written anything up.

jeremy22:02:59

Can’t seem to paste into the repl 🙂

mseddon22:02:07

Huh. I would hope that worked ;) what os are you running?

mseddon22:02:57

Ensure the cursor is blinking and not hollow. It is 100% possible something is b0rked of course

mseddon22:02:18

Anyhow, no rush. We will let this test run for a while lest we break people

jeremy22:02:40

And on the blinking/not blinking, switching windows seems to get it caught in not blinking every now and then.

jeremy22:02:01

But, blinking or not doesn’t make a difference to my ability to paste into the repl.

jeremy22:02:20

I can’t right click on the repl either, so no chance to get the modal to pop up to paste that way.

mseddon22:02:05

That part is just broken huh? Definitely want to solve that one. Clicking on the window may focus the repl and get it blinking again though? I have somewhat hacked focusing the console atm, looking towards letting you stream your own widgets that may have input fields into the console

mseddon22:02:48

I think context menus are eaten by vscode there :/ we could provide our own though

jeremy22:02:09

Yeah, to get it blinking again I just sort of click around until it gets going.

mseddon22:02:05

Yeah that is a bit of a mess atm. I can kludge something to make it work but need to work out a better way

jeremy22:02:37

Is there a name for the style of window that the repl is presented in?

jeremy22:02:48

If that makes sense. Doesn’t seem like a normal editor window.

mseddon22:02:54

It's a vscode Web view

jeremy22:02:12

Didn’t know if there was a vscode abstraction on top of it. 😉

jeremy22:02:28

Or is that the abstraction… whew

mseddon22:02:42

Basically it's a web page with blood sweat and tears attempting to make it a believable vscode window ;)

mseddon22:02:40

Everything is from scratch. It hurt a lot yw 😀

mseddon22:02:48

Theme support is terrible btw. We really can't even get colours from the syntax highlighting theme :/

lilactown23:02:53

hey, I realize this channel is for Calva, but some people in the community expressed interest when I talked previously so I thought I would preview it here before I officially released: Introducing Punk, a REBL-like data browser that runs in… your browser! https://github.com/Lokeh/punk

lilactown23:02:37

(btw I know it’s Emacs in my README video but I promise I also use VS Code/Calva too :P)

mseddon23:02:37

I need to talk to you about this nightmare of a vscode hack

mseddon23:02:10

I want to let you stuff new widgets directly into the repl so you can do your thing for everyone else ;)

lilactown23:02:00

well and I’ve been thinking about the other direction… how could I get a REPL into Punk? 🤔

lilactown23:02:14

if I understand what you mean

mseddon23:02:20

It's gonna get sloppy but I reckon we can work it out. Trick is... to let the clojure host inject into our webview

lilactown23:02:39

but either way yes! I think integrating would be super cool

mseddon23:02:22

I think we will need to inject nREPL middleware and faff around using the cljs compiler, but it is doable with a lot of pain :)

mseddon23:02:05

At bare minimum getting punk in would be great, but you strike me as a hairy undocumented lisp/dom hacker 😀

lilactown23:02:00

😬 well one thing I wanted to avoid with Punk was forcing people to hack around with nREPL stuff like REBL makes you do with most modern setups

lilactown23:02:17

so my workflow right now is built around tap>ing values to be sent out

lilactown23:02:41

also I’m not sure if I should take > hairy undocumented lisp/dom hacker as a compliment or an insult 😂

mseddon23:02:21

I haven't even touched tap> yet. Mostly because I am waiting for cider-nrepl to not NPE when I ask for a stacktrace under 1.10 😂

mseddon23:02:35

Oh that's definitely a compliment ;)

mseddon23:02:29

But yeah. I have a few crazy ideas. Ultimately I want to be able to import e.g a rebl or graph api in my codebase and allow people to splat out their widgets directly into the console.

lilactown23:02:48

that would be pretty cool!

lilactown23:02:13

it seems like there’s lots of attempts at these kind of debugging dashboards like Punk, re-frame-10x, data-frisk-reagent

lilactown23:02:38

I’d have to think about what the UX would be like for Punk embedded in a REPL

mseddon23:02:03

Yeah. The battlefield is littered with bodies. Ready to go over thr top? ;)

mseddon23:02:37

Actually in the longer term I think the ability for you to provide a rebl tab is also vital

mseddon23:02:05

So stuffing it in a repl is not necessarily the way forward.

mseddon23:02:53

But again, it should be the same principle, inline in the repl it would be less usable though.

mseddon23:02:09

You would get a tab!

lilactown23:02:13

yeah. I think having a tab or another window open, but having it all integrated and managed in one place

lilactown23:02:43

I feel like I have plenty of mountains to climb just getting Punk sorted out 😅 I still have yet to get it working in a JVM

mattly23:02:13

man I wish I could have the vscode terminal in a tab as well

mseddon23:02:02

Vscode. So Microsoft. So... wat u doing? :)

mseddon23:02:32

We're looking at putting all the repls in a single 'calva' window. So you could have first class place in there

lilactown23:02:11

🤔 it sounds like the new Calva REPL just runs like a web page in VS Code. so atm if you’re doing server-side stuff, it might not be too hard at all to plop Punk on a page similarly

lilactown23:02:56

the tricky bit would be getting to connected to a web app, which I think is the hardest thing to do with REBL too

mseddon23:02:12

That's the fun. You can fit. Just need a way to let you inject there as a dev dependency. It's a rough sketch atm in my head but this is what I am after long term

mseddon23:02:47

As far as comms go, you get a postmessage type api that connects you to the running process you can use

lilactown23:02:34

talking about communicating with VS Code?

mseddon23:02:20

And the clojure(script) endpoints

lilactown23:02:49

🤔 what do you mean?

mseddon23:02:53

I pass right through to do e.g. code completion in the repl.

lilactown23:02:18

interesting…

mseddon23:02:20

With some design I can route you anywhere :)

mseddon23:02:53

Check up! I have a repl beta for you if you missed it 😀

mseddon23:02:12

It's shiny

mseddon23:02:31

But very internal. Need to open it up in a way that is usable. Lisp is about you kicking ass 🙏

lilactown23:02:21

I’ll give it a spin!

mseddon23:02:01

Dis gon git real

mseddon23:02:41

You are the perfect initial use case :)