This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-09
Channels
- # announcements (1)
- # arachne (1)
- # beginners (34)
- # boot (5)
- # calva (68)
- # cider (34)
- # cljs-dev (1)
- # clojure (36)
- # clojure-italy (8)
- # clojure-spec (16)
- # clojure-uk (58)
- # clojurescript (29)
- # cursive (2)
- # datascript (9)
- # datomic (3)
- # emacs (10)
- # figwheel (1)
- # figwheel-main (11)
- # fulcro (33)
- # luminus (5)
- # mount (2)
- # nrepl (42)
- # off-topic (3)
- # other-languages (2)
- # parinfer (3)
- # perun (4)
- # prelude (3)
- # re-frame (6)
- # reagent (5)
- # shadow-cljs (23)
- # sql (37)
- # testing (1)
(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.)
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.)
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.
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
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.
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.
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?
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. 😀
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.
It used to be possible to use Calva Formatter stand-alone, but we closed that possibility the other day.
Is it possible that "evaluate and send printed/returned results to a plain text place" could still be added to Calva?
Filed as an issue... https://github.com/BetterThanTomorrow/calva/issues/123
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.)
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-test
without 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.
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”?
https://github.com/BetterThanTomorrow/calva-fmt 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
ww)
however for some macros/functions it makes more sense to indent them like defn’s, e.g.
(defabc foo
ww)
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
I think my answer might be here: https://github.com/weavejester/cljfmt