Fork me on GitHub

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?


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


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


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


There's also an online demo of 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!).


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.


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

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.


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.


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


It’s not possible, unfortunately.


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.


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


My VS Code settings.json on GH has a custom REPL command snippet to start Portal: -- 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.


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

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.


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


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


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


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.


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


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


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.


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.