Fork me on GitHub
#calva
<
2019-02-09
>
pez00:02:53

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

lspector00:02:43

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

pez00:02:18

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

lspector00:02:49

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

pez00:02:21

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

pez00:02:53

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

lspector00:02:06

trying the new thing and finding it odd

lspector00:02:52

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

lspector00:02:09

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

lspector00:02:13

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

lspector00:02:59

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

lspector00:02:20

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.

lspector00:02:17

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

lspector00:02:44

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

lspector00:02:20

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

lspector00:02:46

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

lspector00:02:50

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?

lspector01:02:43

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

pez07:02:20

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.

pez09:02:54

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.

pez14:02:28

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!

lspector15:02:12

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

lspector15:02:35

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.

pez15:02:31

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

lspector15:02:10

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

pez15:02:41

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?

pez15:02:33

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.

lspector15:02:03

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.

pez15:02:13

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

lspector15:02:57

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?

pez15:02:14

It would be to a (comment).

pez15:02:19

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

lspector15:02:23

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.

lspector15:02:16

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.

pez15:02:24

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

lspector15:02:38

What other clojure extension?

pez15:02:32

It is named Clojure. By Andrey Lisin.

lspector15:02:45

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

pez15:02:58

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

lspector15:02:14

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.

lspector15:02:58

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

pez15:02:15

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

lspector15:02:31

Yeah, I just tried that 😞

lspector15:02:08

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

pez15:02:41

Yes, please file that as a feature request.

lspector15:02:41

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.

pez15:02:30

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.

lspector16:02:12

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?

lspector16:02:45

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.

pez16:02:36

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

pez16:02:38

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.

unni05:02:45

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

unni05:02:03

that is how my emacs/cider setup works 😄

pez07:02:18

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

hmaurer23:02:47

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”?

hmaurer23:02:00

(instead of vertically aligning arguments)

hmaurer23:02:06

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

Chase23:02:49

https://github.com/BetterThanTomorrow/calva-fmt Might have something for you. or the paredit one. does C-M-i do anything for ya?

hmaurer23:02:54

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

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

Chase23:02:17

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

hmaurer23:02:32

@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

hmaurer23:02:36

thanks for replying though 😛

hmaurer23:02:12

ah it’s WIP