Fork me on GitHub

(My mentioning about latest published Calva not reporting what is evaluated was because I was thinking about inline evaluation, not when sending it to the repl.)


got the file but not sure what to do with it 😕


The vsix I linked to is a preview of the coming version of Calva. With a completely new way of providing a REPL prompt.


I think I want what you provide inline but just not inline. I often have values that are too big for that, and I don't want it in the editor


You can install that vsix from the vscode extension pane. There is a mini menu at the top of that pane.


The currently published version, 1.3.61, outputs the result of inline evals in the Output channel “Calva says”, I think without reporting what it evaluates. (I have regarded that as a bug, but might be persuaded otherwise.)


trying the new thing and finding it odd


output comes in a new pane on the right, not the calva says pane


but I see that a lot is different and it might be really good! just confused at first sight


in the pane on the right I get both the code and the output, while down below I get none of it


key thing for my purposes is that output and printed values appear somewhere, with nothing else (no code, no prompts or extra messages)


If the REPL is where it's showing up then there would be one prompt from before you do it and one after, but between just printed output and values. Might be nice for it actually to be not in the REPL, but it should be somewhere that's not inline and from where one can copy it, etc.


oh wait! I think I wasn't doing the command you intended...


AH, it does what I want if I evaluate it in the way that makes it show up inline, except that also puts it inline, which I've always found confusing


Took me a bit to get used to the idea but I think this will work well for me.


FWIW my ideal version would do this but without putting anything inline in the editor


Tooltip function documentation isn't showing arglist, just function name and the doc string. Was that always the case? Is there some other way to see arglists?


With 1.3.62 I don't seem to have just a regular REPL anywhere.... The Clojure Says area doesn't allow typing... Will revert for now to 1.3.61


In 1.3.62 the REPL has to the REPL window (I think that is what you refer to as the new pane on the right). There's a point in the evaluated form being sent there. With alt+up/down you can access the repl history and fiddle with the forms.


Also, @lspector, note that the fact that the Calva says log does not log the form being evaluated is actually a recently introduced bug. It is supposed to log both what is evaluated and the result.


Folks. I have just published a new version of Calva, 1.3.62. It should not be confused with the preview version some of you have helped testing. This one contains only some fixes for running tests. Now all namespaces are loaded before tests are run, so that when running all tests all tests are run(!), and when running namespace tests, tests in any corresponding -test namespace are run. The latter becomes a bit slow for the first test run in large projects. I am trying to solve that, but wanted to get this fix out first. Cheers!


@pez, re: the REPL window in 1.3.62, how does one make it appear just to do some REPL interactions, without sending something there? I didn't see how. But re: your comment that "Calva Says" will, after bug-fix, also include the evaluated code: that means that this won't provided the functionality I want after all. The functionality is "evaluate stuff and show printed & returned results somewhere, not cluttered up with anything else." Ideally "stuff" can be a selection and/or a whole buffer and/or the current expression, but selection or whole buffer would suffice.


Oh, and I think Calva actually does provide this functionality currently except that "somewhere" is "inline in the editor", and that unfortunately defeats the purpose, since large values can't easily be seen, it can't easily be copied elsewhere, it goes away when you edit, and it's strange that it's on top of the editor. Any other text output place would be great.


In that preview there is a command for opening the repl window.


Ah, so I assume I should open the command palette, search for calva, and look through that to find the way to open the REPL window...


As for evaluation output... There is a feature request for a command to evaluate into a comment block in the buffer. And there is a command for copying the last evaluated result. Any of those two options that would work for you?


Yeah, search for calva and/or repl in the command palette. We will give it a default shortcut as well, and further down the road the window will automatically open when Calva activates.


On "evaluate into a comment block in the buffet" -- this would apply to any selection? That would be good. But then it goes into the file you're editing (and might not want to change)? That would be awkward. And what kind of a comment block? If it's made with ";" on every line then that clutter would also be awkward, while if it's in (comment ...) then I think some combinations of printed text and return values will break it.


The repl window will also, at some point, start to support large results much better.


On "copying the last evaluated result", if I understand correctly it wouldn't handle evaluating a bunch of expressions in a selection, or seeing printed results, right?


It would be to a (comment).


Copying last evaluated results evaluates *1 and puts that on the clipboard.


Yeah, so unfortunately I don't think either of those options will do. What I want is simpler, I think, and for me more useful than any of these fancier things: evaluate and send all output (printed/returned) somewhere as plain text, where I can see/copy/whatever it. It can be the REPL or somewhere else, but not mixed with anything else, not messing up the file I'm editing, and not as ephemeral inline stuff.


FWIW this is roughly what one gets in Gorilla REPL from evaluating a cell, and I think is the most basic way to evaluate buffer text in a bunch of Clojure IDEs and before that other Lisp IDEs.


Maybe the other clojure extension works more like you want? Calva came to be because i wanted inline evals. 😀


What other clojure extension?


It is named Clojure. By Andrey Lisin.


Thanks -- I had no idea. Looking...


It is not as actively maintained, but it isn't abandoned either.


Seeing if I can figure it out... but to be clear, I like Calva! The re-indentation is getting good (a totally crucial feature IMHO) and there's other good stuff, and you (and others?) are really helpful!! But seeing results of evaluated stuff, as plain uncluttered text, is a kind of basic thing that I guess I do need.


Looks like the other Clojure plugin doesn't do re-indentation 😞


It used to be possible to use Calva Formatter stand-alone, but we closed that possibility the other day.


Yeah, I just tried that 😞


Is it possible that "evaluate and send printed/returned results to a plain text place" could still be added to Calva?


Yes, please file that as a feature request.


FWIW the workaround I've adopted is to put top-level calls I want to evaluate in -main and re-run the whole project with lein run from a terminal, which will evaluate the current versions of everything in the file I'm working on and print results of the top-level calls in the terminal. Seems like a long way around when Calva seems to have a dozen ways to evaluate things within the IDE, but all of them show outputs in ways that are fancier but less useful to me.


Very long way around indeed! If you can stand the inline display (just press ESC to dismiss) then the results are printed in the output.


Alas, if the output is a map that would fill several screens, the inline thing just can't do it. Also, so printed output (just results), right?


Many (maybe most) of the outputs I want to see fall into at least one of these categories. A terminal/REPL output buffer handles them all fine.


Due to limitations of vscode, the inline thing really is only for short results or for peeking some at larger results. For working with larger results we print to the Calva says log, offer to evaluate it in the repl (soon repl window), and support copying it to the clipboard. We will find other ways to better support large data structures, It will take us a while to get there, though. (Not talking about your feature request here, that shouldn’t be too hard, and is more of a decision to make if we are ready to add that to the maintenance pile.)

👍 5

Folks, anyone have a Emacs/Cider setup handy? If so I’d like to know if running namespace tests for namespace foo, runs the tests in foo-testwithout foo-test first being loaded. I’m trying to see where such thing would be happening in the Cider code, but can’t figure it out.


You first need to load the test ns before you can run test from src namespace.


that is how my emacs/cider setup works 😄


Thanks! That explains why I couldn’t see where the test was loaded in the code. 😃


Hi! I just started using Calva and I am wondering if there is a way to tell it to indent some functions/macros like a “defn”?


(instead of vertically aligning arguments)


Cursive has an option for this but I can’t find it on Calva

Chase23:02:49 Might have something for you. or the paredit one. does C-M-i do anything for ya?


@chase-lambert thanks! I have the fmt option enabled, but it seems to indent everything in the same way, i.e.

(defabc foo
however for some macros/functions it makes more sense to indent them like defn’s, e.g.
(defabc foo


ahhh, ok. maybe C-shift-i to deindent? Anyways, I'm not the guy to talk to, hopefully someone else in the Saturday night skeleton crew can help


@chase-lambert yep I can de-indent manually but it’s annoying to do everytime 😞 Cursive (the plugin for intellij) has a configuration to specify “treat this symbol like a defn“, and it then indents it as such


thanks for replying though 😛


ah it’s WIP