This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-22
Channels
- # announcements (17)
- # beginners (11)
- # biff (5)
- # calva (22)
- # cider (30)
- # clj-kondo (33)
- # clj-on-windows (20)
- # clojure (59)
- # clojure-dev (25)
- # clojure-europe (31)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-sweden (5)
- # clojure-uk (6)
- # clojurescript (5)
- # community-development (2)
- # cursive (4)
- # datahike (5)
- # datalevin (7)
- # datomic (11)
- # emacs (8)
- # events (1)
- # gratitude (1)
- # hoplon (5)
- # hyperfiddle (1)
- # lsp (59)
- # matrix (11)
- # polylith (14)
- # portal (3)
- # practicalli (1)
- # rdf (2)
- # reitit (9)
- # releases (3)
- # rum (5)
- # yamlscript (6)
Dear Calva maintainers,
I got some feedback regarding outputDestinations
💡
When setting all outputDestinations
to terminal
.
1. I’m finding REPL window not very useful. I would appreciate toggle in settings to not pop the window up.
2. Visual presentation of output and result is obscure, it’s hard to differentiate the output from the result. I would love to be able to hook into printing process and format values to my liking. I’m also confused why output nil
is printed to terminal, couldn’t we filter this surplus information out?
3. Error representation lacks stacktrace thus I have to use pst
to once again see the full error. Would love to at least have an option to automatically print the full error out.
Thank you for considering my input and your hard work in making Calva such a lovely tool it’s now!
All the best!
Karol
Hi! Thanks for providing feedback!
1. There’s a setting for not automatically opening the REPL window when the REPL is connected. Is that what you need?
2.
a. This will somewhat depend on your theme. We could provide some configurability for it, but I’m a bit hesitant with settings in general. Issue welcome, and we can discuss it there.
b. Not sure what you mean with the nil
. It’s the result of evaluating some forms. There is no reliable way for Calva to know if it is to be considered surplus or not. But maybe I am not understanding the concern…
3. Again, I’m weary about adding settings. You could make keyboard shortcut for quickly calling pst
.
{
"key": "ctrl+alt+c -",
"command": "calva.runCustomREPLCommand",
"args": {
"snippet": "(clojure.repl/pst)"
}
},
1. Oh, very sorry! Indeed I overlooked this option 😍 2. a & b I expressed myself poorly, let me correct it. What I mean is when evaluating a form like (println ”hello”) I’m getting „hello” in terminal and nil for result. Since there is no preamble of ——-RESULT——- and ——OUTPUT——- it’s sometimes hard to differentiate between those two. 3. Okay, that’s also an option! Thanks 🙏
Thanks for clarifying about ouput vs results. It’s by design we don’t label them. We could consider an option letting you do this, and an issue is welcome. Again, I prefer not adding options, but maybe I can be convinced. With the theme I am using (GitHub Dark Default) the difference is pretty striking, just saying. I find myself mostly using the Calva Inspector for results, btw.
I'll add that I mostly use Portal for results and that makes it very easy to view output and results separately -- but since the switch to the terminal-based output destination, I've actually started using that window much more than I used to use the old REPL window -- not sure why... guess I find the new output style more pleasant to read?
When I hit tab
with Calva what controls the indentation level? I have a macro that I have defined in my clj-kondo config to be a normal function defn
but when I hit tab
it takes the indentation to a whole new level for all the lines and I am not sure where that setting is coming from....
It does not do it on normal functions so I am assuming something is not reading this macro which looks like a normal function body correctly
I think there was a field name change a while ago regarding .cljfmt.edn
But that might not be your issue... just for reference I use this in my .clj-kondo/config.edn
{:lint-as {uix.core/defui clojure.core/defn}}
Yea I have my macro in the clj-kondo under lint-as
the same way.
Looks like its just a cljfmt issue. Does anyone know how to fmt a macro as a function with cljfmt?
Looks like I can use the .lsp/config.edn
and use the :cljfmt
key for my settings too
This link in the cljfmt thread is broken https://calva.readthedocs.io/en/latest/formatting.html
{:extra-indents
{use-subscribe [[:inner 0]]
use-event-listener [[:inner 0]]
use-shortcut [[:inner 0]]
$ [[:inner 0]]}}
Example of what my .cljfmt.edn
looks like to get the defn
-like indentationHmm does not seem to do it with my symbols.... I will look into the settings more. Thanks for the help!
Where did you find that link, @U05NZDGDYG3?
If you use .lsp/config.edn
for the formatting setting, you need to give Calva a special cljfmt config path of CLOJURE-LSP
. You also lose hot reloading of the formatting config, so I suggest that at least while figuring the right config out you just use .cljfrmt.edn
in your project/window root.
Thanks!
I'm an Emacs user who decided to try out VSCode + Calva today as I am preparing to onboard a new dev who doesn't use Emacs. Is there a way to view the documentation of a function without using the mouse to hover over? In Emacs there's an lsp command that brings up a small interface showing the docstring and function signature, which is helpful when I forget the order of arguments
if you're in a REPL you can just call (doc map)
I’ve turned off all hovering (because it drives me crazy) but when I want to see the popups I use the key combo CMD+K, CMD+I.
Exactly what I was looking for, thank you! I may end up switching entirely to Calva
Yeah, I liked the hover docs for a long time but a month or two ago I turned that off and I'm using ctrl+k ctrl+i
(Windows) now when I need docs -- which is probably more often than I ought to admit 🙂