Fork me on GitHub
#calva
<
2022-05-07
>
pinkfrog03:05:44

Looking at a video that uses atom to edit clj. For the evaluated results, it is possible to expand the nested data structure right inside atom. Does Calva also has the same functionality?https://youtu.be/rh5J4vacG98?t=1097

seancorfield03:05:11

I would recommend looking at Portal. It has a VS Code extension and Calva has built-in keybindings to tap> values into Portal and then you can navigate around the data structures, even using datafy/`nav`.

seancorfield03:05:19

There's a #portal channel if you want to know more.

seancorfield03:05:01

(Atom is losing ground to VS Code and ProtoREPL is unmaintained at this point, although there is Chlorine now which is well-maintained)

seancorfield03:05:17

There's also an online demo of Portal https://djblue.github.io/portal/ where you can load demo data and then play with it in the browser (the browser version of Portal was the original, then the VS Code version, and now there's an IntelliJ/Cursive version as well!).

pinkfrog04:05:26

I am using portal in vscode now. One thing I really like from the above video is that, no need to open an extra window on the size. The values are directly shown (expanded) along side the code. An extra window is often times overkill and takes much screen size.

seancorfield04:05:01

Ah, fair enough. I use Portal instead of having a REPL window visible so my screen is code on the left, Portal on the right split maybe 60/40, and I hide/show the explorer/git/etc panel as needed.

thanks3 1
seancorfield04:05:34

I started using REBL when it was released for tap>'d data, then switched to Reveal, then to Portal (just before it sprouted the VS Code extension). I like that it's just another tab in VS Code that I can move between groups and so I can have one big group filling the whole screen or split-screen with two code views, or have code + Portal side-by-side.

seancorfield04:05:04

I've started added some custom REPL command snippets to navigate Portal without leaving code, so I can expand/collapse parts of the most recently-tapped value.

seancorfield04:05:31

I don't know how flexible VS Code's inline results machinery is -- I know the Chlorine/Clover maintainer has complained that the inline tree view for results that he has for Chlorine in Atom doesn't seem to be possible in Clover for VS Code...

pez07:05:23

It’s not possible, unfortunately.

orestis08:05:58

Oh, calva has built in keybindings to tap values to Portal? Is there a demo somewhere that shows how to get things working with Calva and Portal? My understanding was that the VSCode extension started portal outside of the JVM.

seancorfield17:05:36

ctrl-shift-t t (current form or selection) and ctrl-shift-t space (top-level form) are generic tap> invocations -- which will end up in any tap listener (REBL, Reveal, Portal, etc).

seancorfield17:05:23

My VS Code settings.json on GH has a custom REPL command snippet to start Portal: https://github.com/seancorfield/vscode-calva-setup/blob/develop/settings.json#L238 -- if you have the Portal extension installed in VS Code, you can tell the backend (the Portal launcher) to launch into VS Code itself. The same for the IntelliJ plugin version of Portal.

seancorfield18:05:11

I have some more stuff to add to my Calva/Portal setup and then I'll do a screencast about it and write it up in a blog post.

👍 2
1
orestis19:05:44

Ah thanks @U04V70XH6 - I thought that Portal and Calva had a tighter integration without project specific settings. Perhaps I will need to open an issue to discuss.

seancorfield20:05:48

@U7PBP4UVA I'm switching from Clover to using Calva's REPL stuff so I'm rewriting all my Clover customization to REPL snippets in Calva and that includes my Portal integration. For both Clover and Calva, it's worth having a shortcut to launch Portal but the mechanics are identical.

seancorfield20:05:26

I'm literally copying code from my Clover config.cljs into Calva's REPL snippets 🙂

seancorfield20:05:59

> I thought that Portal and Calva had a tighter integration without project specific settings @U7PBP4UVA I'm curious as to what "tighter integration" you're thinking of? Portal launches inside VS Code so it's "just another tab" like everything in VS Code.

orestis03:05:28

I have a (perhaps stubborn) refusal to include Portal in my CLJ project deps, and I'm doing both CLJ and CLJS development. So I'd like to use Portal solely as an editor element. That is, I expect: • A special window like calva.output (done) • a command to show it/hide it • A command to send the last result to portal. Perhaps I'm looking for an equivalent to CIDER inspector, that works without any special configuration.

seancorfield03:05:20

:portal is in my dot-clojure deps.edn, not in my project. But my dev REPL ends up with a bunch of tools -- and I start it outside VS Code.

seancorfield03:05:52

Do you have nREPL active when you're developing @U7PBP4UVA? That doesn't go into production tho', right? Portal's just the same surely?

orestis03:05:43

I do, but nRepl takes care to minimize and vendor dependencies. Portal brings in a whole web server :) As I said, perhaps my refusal is unreasonable. I still have to figure out a way to do CLJS with the same setup though. I thought that Calva having access to both the dev env and the nRepl results can just shuffle data over to portal.

pez11:05:54

Reminder to check out #joyride if you script VS Code using Clojure sounds interesting. With Joyride you can also make Calva do new things. E.g. One of the examples in the repository adds a Toggle Ignore Form command, something that is frequently requested in this channel.