This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-04
Channels
- # announcements (1)
- # babashka (7)
- # beginners (25)
- # calva (38)
- # cider (2)
- # clerk (54)
- # clojure (21)
- # clojure-austin (1)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (2)
- # clr (16)
- # conjure (2)
- # cursive (15)
- # datalevin (1)
- # datomic (2)
- # emacs (3)
- # fulcro (1)
- # hoplon (14)
- # humbleui (9)
- # hyperfiddle (31)
- # improve-getting-started (12)
- # jobs (7)
- # off-topic (15)
- # reitit (3)
- # releases (1)
- # spacemacs (22)
- # squint (16)
- # tools-deps (8)
- # vim (50)
- # xtdb (33)
Is there a way to create a script for calva to run when jacking in? I'd like to customize the lein update-in :dependencies conj '[nrepl,"1.0.0"]'
code
Not currently. There’s an issue about it, I think. Maybe you can describe your use case a bit there?
Hello! feedback on the test runner UI, working great so far but this one quirk, is this a known issue? I can’t seem to find how to clear them other than reloading vscode (video below: I’m renaming the deftest and all the name is recorded in the UI before I finished renaming)
I've brought this up before, but never filed an issue. That and I couldn't find a reliable way to clear/hide inline failure reporting when it was either stale or interfering with my ability to edit relevant code. My take from pez's comments at the time was that the VS Code test runner is legacy from the early days of Calva. It is not getting attention anymore because pez doesn't use it anymore. Seemed easiest to me to just move on and pretend it's not there. Somehow or other, I guess I must have disabled the feature? (Probably just a settings toggle.) And then I moved toward other test runners that work in the repl and/or the terminal.
The test explorer integration is pretty new, actually. Unfortunately the contributor is no longer doing Clojure. But that does not mean we are not maintaining it. Quite the opposite, and I wish you wouldn’t imply things like that, @U90R0EPHA. It is a big feature, though, with a lot of integration points. The API in VS Code is, as is very common, not built with a dynamic environment like Clojure’s in mind. It makes it hard to create a clean integration.
Did not mean to offend. Just sharing my interpretation of and response to previous discussion. I knew you were already involved in this conversation, and could substantiate or refute my perspective.
Yeah, I guess I should be scrutinizing what I have said about it that gives the impression that we don’t give attention to the test runner things. No offense taken!
Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.346
• https://github.com/BetterThanTomorrow/calva/issues/2139
From https://calva.io/clojure-lsp/#extra-commands:
> When using the command, provide the args as a tuple of [command-name, arguments]
, where arguments
is an array of any arguments after file-uri, row, col
which are common for all clojure-lsp extra commands and are provided automatically by Calva, based on active text editor and where the cursor is. It can look like so when binding a shortcut for extract-function
:
>
{
> "key": "ctrl+alt+r f",
> "command": "clojure-lsp.command",
> "args": ["extract-function", ["new-function"]]
> },
pardon - calva/vscode noob. How do I customize the colors/appearance of things? for example I want function names to be bolded like intellij/cursive. is there a doc for that somewhere?
Welcome to Calva! You could probably find some theme that does this for you. There’s some info here about how to customize themes. https://code.visualstudio.com/docs/getstarted/themes I see an example there for making declarations bold.
Can I evaluate the whole file without executing comment forms? I often evaluate the whole file for setup purposes and then evaluate comment forms depending on what I need.
There is a command for loading/evaluating the current file, if that’s what you mean. Search in the command palette and you will find it. Nothing in comment forms is executed when you evaluate the file. I can recommend looking at the source for the comment
macro.
Ok, my bad I was pretty sure it was evaulating comment
macros as rich comments.
Interpretation error
Are you a beginner to Clojure, @U0111PVCS8P? This interpretation of Rich Comments is interesting.
The way you are using the comment forms is exactly what is meant by Rich Comments, actually. They have their name from Rich Hickey, who is known to use them like that too, plus that there often is riches inside them.
Calva doesn't need to do anything to avoid evaluating your code inside a rich comment.
The comment
form is actually evaluated. But it is a macro. And what that macro does is intentionally ignore the body (your "commented" code) and just evaluate to nil
.
I’m not a beginner to Clojure, I’m just mixing things up, sorry. I just know calva can eval comment forms as do forms, I thought it was doing that when I used “eval whole file”
I also was misinterpreting “rich comments”. For some reason I thought rich comments was about the IDE adding features to comment, just like the “eval as do” calva command
I see. Of course using fancy terms like Rich Comment Forms is prone to relay some other things than intended. It has just never occurred to me. Thanks for elaborating. Interesting stuff words and such! 😃
"I just know calva can eval comment forms as do forms" -- that's not quite right (is it @U0ETXRFEW?) -- you can evaluate an individual form inside (comment ..)
but if you evaluate the whole (comment ..)
none of the forms inside are evaluated (and you just get nil
back from the comment
macro).
I wonder how we can talk about this more clearly... I recently overhauled part of https://clojure-doc.org and mentioned Rich Comment Forms: https://clojure-doc.org/articles/tutorials/getting_started_cli/#interactive-development -- I'd be interested in your feedback on whether that's equally confusing?
(I've surfaced that Q in #C02CPM2R1KK because I'd like general feedback, not just Calva-specific feedback)
I think it has been suggested to be able to evaluate the whole comment content as a do form. But I don’t recall implementing it…
Rich comments are a language feature, rather than editor feature. But you do need an editor/IDE to take full advantage of them. The beauty is that an editor can offer linting, highlight, evaluation, etc. without needing to even know the "comment"ed code is not going to run by default. And we don't need super-complex parsing to try and and make imperfect guesses of what is or isn't code, like we would if it was a normal comment.
Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.347 • https://github.com/BetterThanTomorrow/calva/issues/2109 So now you can bring your Rich Comments wherever. 😃
(defn -main
"I don't do a whole lot ... yet."
{:rcf (comment
; Now you can alt+enter eval this println
(println "Nested RCF"))}
[& _args]
(println "Hello, World!"))

Hey, I'm pretty sure this is a new warning that has started popping up for me when starting a REPL in Calva.
> The nREPL server does not support cider-nrepl info
op, which indicates troubles ahead. You need to start the REPL with cider-nrepl dependencies met.
From what I can tell the REPL is working fine (at least for what I use it for). Should I be concerned about this ?
I'm using shadow-cljs and connecting the repl to that (I click REPL in the bottom bar, then choose connect to running repl in my project, then choose shadow-cljs, and then choose :app
)
Yes, it’s a new warning. We got a lot of support questions about things not working in Calva because the basic dependencies were not met. You should follow the advice in there and fix it. Calva has a command for copying out the command line it would use to start the REPL. You can use that and compare with the command line you use.
FWIW, we get this warning connecting Calva to nREPL servers running on staging and production -- because we deliberately choose not to have the CIDER middleware present in remote processes -- but I haven't seen anything specific "not work" yet without CIDER for a workflow that interacts with remote servers. I add that caveat because we're not doing anything with source code or tests -- just straightforward evaluation of (local) code into the (remote) process, with display into Portal (using VS Code's Simple Browser, connecting to a Portal server running inside the remote process).
@U0ETXRFEW I think I've asked this before but it would be great if you could add a section to the Calva docs that explicitly lists what "won't work" if the CIDER middleware is omitted -- is that practical or is it too tangled a web to be able to tell for sure what functionality would break?