This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-20
Channels
- # announcements (30)
- # babashka (118)
- # beginners (23)
- # calva (68)
- # cljdoc (10)
- # clojars (13)
- # clojure (90)
- # clojure-bangladesh (1)
- # clojure-europe (27)
- # clojure-gamedev (1)
- # clojure-nl (11)
- # clojure-uk (4)
- # clojurescript (59)
- # community-development (3)
- # cursive (13)
- # datomic (39)
- # defnpodcast (1)
- # emacs (10)
- # figwheel-main (1)
- # fulcro (18)
- # graalvm (21)
- # honeysql (1)
- # introduce-yourself (1)
- # juxt (1)
- # lsp (197)
- # malli (19)
- # off-topic (28)
- # practicalli (2)
- # re-frame (42)
- # reagent (4)
- # reitit (7)
- # releases (2)
- # sci (35)
- # shadow-cljs (13)
- # spacemacs (4)
- # vim (3)
Crazy feature request, if I try to eval something but I'm not connected to the repl, offer me a prompt to connect?

I like it. We could use the same quick pick menu as when you click the REPL button in the status bar. Please file as an issue on Github.
We could even consider dropping this menu down when Calva has started. Ancient versions of Calva even supported to just auto-connect (the reasons for removing that might not apply anymore, coming to think of it.)
Conjure (the nvim plugin) auto connected if there's a nrepl file readily. It worked 95% of the time, with the other 5% being stale files that occasionally happen, which would be an issue in any case. But it doesn't support CLJS repl or selecting a build, which could be an issue.
VS Code seems to reopen the window as it was, which is often on "the wrong project", so actually I like having connection not too automatic.
I recall similar issues with Calva's auto-connect. If we drop that menu down on startup, it would remember the last value selected. So if you are a connecter then pressing enter would connect you. And similarly of you use jack-in.
Good input @U0HG4EHMH. Any auto-connect feature would need to be opt-in via settings, I think.
I already started a “autostart/connect” ticket a few days ago, mostly to make calva dev easier: https://github.com/BetterThanTomorrow/calva/issues/1464 having this would make autoconnect worth the work for normal dev, so I’m in favor
Thanks, @U02EMBDU2JU. Let's bring the auto-connect discussion there. I still would like a FR on the thing you suggested, @U7PBP4UVA. 😃
Here's a request for help with Calva. There are two tiers to the request:
1. Help us understand more about the rationale behind choosing/not choosing Calva
2. Help promote Calva
I think I have noticed an increased activity in this channel and also on Github. More users, more engaged users, more questions, more PRs, etcetera. Yes, I am an optimist and might extrapolate on things, but anyway.
• Towards tier 1, I'd be super happy for replies to this thread about reasons why you might have started/restarted using Calva. And I am of course also curious about why you might have stopped using Calva for something else.
• Tier 2: Please consider blogging, tweeting, etcetera about your Calva usage. There is not that much such content out there and I think a lot of people might still get the impression, from Google, that learning Clojure means learning Emacs as well. Also please consider writing a review on the VS Code extension marketplace.
Tons of thanks in advance, dear Calva friends! 🙏 ❤️

I think Calva is wonderful and use it sometimes. The reason it is not my primary is that my brain is wired to spacemacs-ish key bindings. I tried VSpaceCode and it is a start, but does not offer a full spacemacs-ish experience. https://github.com/VSpaceCode/VSpaceCode/issues/185, but it turns out it is quite difficult, at least for me!

I started using Sublime Text back when I was in DevOps and was mostly viewing logs and writing small Python scripts. When I got a job writing Haskell I switched to VSCode because the tooling support was better and it was more similar to what I was used to than emacs or vim. When I got a job writing Clojure, Calva seemed like the most popular VSCode extension so I tried it out and I've been using it happily ever since.

I was using VS Code already and I never learned to use Emacs. Tried Cursive a bit but like VSCode more than Intellij for broader support of other formats

IMO Calva improved tremendously over the past year (thanks also to clj-kondo and lsp )



I use Calva for all the static stuff and the editor experience in general but I still have to use Clover for evaluation because we use plain Socket REPLs everywhere, not nREPL etc. I do find that the combination of all those moving parts can be a bit fragile though -- I often get "hangs" in some of my larger, more complex files waiting for something (either LSP or maybe something in Calva's formatter?) to catch up with my editing, so there are times when I have to either roll LSP back to an earlier version or just disable Calva completely for a while.

@seancorfield how complex are those files? Is EDN? Is it very large files?
About the only thing I've managed to figure out that they have in common is that they have either large case
statements or large hash map literals (as well as a bunch of other code). I should just break them up into multiple files but... you know how that goes 🙂 honey/sql.cljc
is probably the only publicly-accessible file I have where this happens often enough to be close to reproducible.
I edited a docstring in it yesterday and it took about a minute before the syntax-coloring, post-LSP, came back into sync.
Specifically, I edited this https://github.com/seancorfield/honeysql/blob/issue-351/src/honey/sql.cljc#L1364 (on this branch).
(so anyone can try to repro)
When I first started building websites (over 10 years ago, with PHP and MySQL) I used Panic’s Coda as my editor. At some point, maybe 5 or 6 years ago, I switched briefly to Atom and then to VSCode and haven’t looked back since. When I started using Clojure (just over 2 years ago) Calva was ready to use. I don’t even remember that there was any choice other than Calva. The combination of VSCode and Calva is a very good fit for the way I like to work. I’ve never felt the need to learn emacs. I suppose I could (I can get by with vi when working in the shell — and I used to be a whiz editing mainframe code in the TSO/ISPF editor — yikes!) but I haven’t been convinced it would be worth it.

I program in several languages, so I like VSCode because of its good multilanguage support. For years I used Emacs, but I found that I was spending a lot of time maintaining my Emacs config and keeping up with new extensions and updates to old ones, which is much easier with VSCode. And it’s just less fragile than Emacs. So Calva was a natural for my Cloure/script work. The only thing I really miss from Emacs is evil mode. I briefly tried VSCode’s vim emulation and didn’t like it, not least because it doesn’t play well with Calva. So here I am. For me, Calva is terrific, with excellent, often instantaneous support from @U0ETXRFEW and @U9A1RLFNV.

Love Calva. A beginner with all things not VBA. Started for the WSL integration via VSCode. Still at the beginning of my experience. Naturally, my own project will be REPL developed, but at the moment I am stepping through (learning) someone else's code through the Calva debugger. Paredit is excellent after training the fingers on my left hand, and I agree with the key mappings chosen.

We are thinking of using calva primarily because it supports custom macros and our codebase has a ton of boilerplate that really can only be macro'd by macros we have no way to teach cursive about The primary reason I keep coming back to cursive personally even though I am asking all the other engineers to use calva so we can make that change is 1. I've been using cursive for a long time and it's hard to break those habits (esp. with it's particular implementation of parinfer) 2. This might sound silly, but the repl being a text buffer makes it hard to know when it's actually submitted a form and when it's just hanging and I need to restart the thing 3. The thrashing of the .nrepl-port file which with cursive we just checked in is like the dumbest thing to be annoyed but it gets me 4. ... More vibes I should write down. But in general the engineers who are new to clojure and started with it are having a grand time (though I don't think they are working particularly repl driven)
Rational for choosing Calva: I’m a Java developer and I’m looking for features like I used in Intellij. I know emacs quite well, but wanted to try something new. Calva has all the refactoring I need. I’ve actually found VSCode itself wanting, as compared with Intellij - git integration is not good even with various plugins, for instance, and window management is kinda subpar, etc…. But I can overlook those things due to Calva being quite nice to use. Calva promotion: This is a personal thing for me. I plug Clojure at work, but the chance of adoption is near zero. I don’t have a blog or use twitter, although I might start. I’ll think about where else I can apply influence though. And hey, what you all have created is pretty nice and getting better!

I really like Calva. not only is the best option for the VSCode world but also one of the best options (to me) out there. I've tried cursive and while it is very good, the size of my projects are too small to really benefit from how heavy IntelliJ is. One of the things that have put me of in the past and made me look for alternatives is that Calva tries to do too much. For example, the whole syntax highlighting project is big in itself with a lot of moving pieces, some bugs, some performance issues, and rewrites some of the defaults VSCode uses for clojure which also interfere with some themes/color schemes. Same with the super coupled implementation of paredit. Paredit is very good but it also interfere with some other extensions like the vim extension and if you have custom key mappings your workflow could be affected. I wish there was a way to disable different parts of calva and go back to defaults. For example I love the whole repl jack-in things, project setup, in-line evaluation, basically all the repl driven development things, but would prefer to be in control of how I edit and highlight the files. Still Calva is one of the best options out there and the one I am currently using.

Here from youtube channel On the Code Again! (https://www.youtube.com/channel/UCKlYSDBb1KBcZyCRbniW1ig)
I was super annoyed about the fragility of Emacs config and the time it takes maintain it. But it was actually the Emacs plugin Magit that kept me suffering the sub-optimal experience for a long time. Now that I found https://marketplace.visualstudio.com/items?itemName=kahole.magit a year ago, I didn't really have any excuses.
I have a few things that I think could be better in Calva:
1. "Print stacktrace" button/link multiplies after REPL restarts. I've opened an issue: https://github.com/BetterThanTomorrow/calva/issues/1542
2. I am getting notified about "Problems" outside my project. So far I haven't identified what trigges it (outside problems aren't there after VS Code have initialized my project). I would prefer them never being displayed... it isn't like I can do anything about them anyway.
3. I can't figure out how to distinguish when I forgot to evaluate a form and when I'm just waiting for something slow (maybe even hanging). I noticed this mostly when using something like cirterium
to benchmark things and I find myself thinking: Did I evaluate the form? Someone else mentioned this above I believe.
4. "Evaluate current top-level form" Alt+x
(at least on Linux) conflicts with some fancy comment thingie (e.g. ;
). Having a piece of code with trailing comments and wanting to evaluate that insteads makes a new line in the comment. It interferes with the flow, and I need to use more awareness for evaluating code.
Thanks, @USW6URK47 ! How well does edamagit compare to magit, would you say? I often hear that people stay with Emacs, only because of magit.
I'd welcome an issue about 3 too. A super easy way to solve it would be to decrease the transparency of the decoration, but it would be good to discuss options.
4 I should remove/change that default key binding. I I trips me up often. You should be able to edit the when clause in keyboard shortcuts settings, I think.
To me the experience is almost the same. Edamagit seems to have all the features (or I haven't noticed any missing and I am using interactive rebase a lot which seems to be on the more exotic end of the spectrum). Workflows in Edamagit is slightly worse in few places but I can live with a 90-95% Magit experience if it gives me VS Code and Calva.
> 2 sounds like some configuration in your project might trip clojure-lsp/clj-kondo up. Also when the problems aren't there after a VS Code restart?... I can have VS Code open for hours and suddenly (I probably click something or hit a keyboard shortcut by mistake) they appear.
I'll think about point 3 a bit more... it seems a bit fluffy and I'm not sure how to "capture" this in an issue.
https://twitter.com/pappapez/status/1494969882605146116?s=20&t=tk0ndNVMamHN9TOmWop_Rg
I think 3 as you formulated it here is fine and a good start for a discussion. And I have a feeling we can spawn at least one more issue out from it.
what would a good title framing the problem be? > Better REPL feedback while waiting for evaluation
I'd say this one is related: https://github.com/BetterThanTomorrow/calva/issues/537
@U3JH98J4R I believe you experienced something similar, maybe pitch in on the issue: https://github.com/BetterThanTomorrow/calva/issues/1543
I think it is correct: https://github.com/hugoduncan/criterium
oops 😅
I see it now
> I am getting notified about “Problems” outside my project. @USW6URK47 An issue about this would be great too. I think I’ve seen this mentioned before.
pez hinted that it most likely is some configuration in my project that makes clojure-lsp/clj-kondo trip up. I'll keep an eye out to see if I can figure out how to consistently re-produce it before reporting it.
@USW6URK47 please let us know if you figure it out. It is probably something we should cover in the documentation.
Your number 4 should be fixed in the latest release, btw. (I think you are already aware, but anyway.)
I sat down this morning and figured out how to consistently reproduce the "unwanted problem reporting": https://github.com/BetterThanTomorrow/calva/issues/1553
Thanks! I seem to remember a discussion about dependencies being linted. I don't recall where I saw it... might have been in #clj-kondo or #lsp
hello guys I use: ``Calva Format: Format and Align Current Form (recursively, experimental)` and the values are aligned to the longest key and other maps are placed at the end of each other. The other formats don't work for some reason. Could you advice what I can do at least remove the alignment to the longest key?
This feature is candidate for removal. It's buggy and causes lots of weirdness like this. I can't offer any other advice than to stop using it. As awful as that feels to say... 😞
is there a similar formatter which I can use? most of my repl outputs are single liners
I don't know of any aligning tool for Clojure. Maybe we could write one based on the elisp for Emacs Clojure mode...
it would be a really useful feature, till then could you not remove the experimental formatting plz ❤️
@U01B65G1Z63 So you want to align the map keys or not? If it doesn’t align them to the longest key, how would it align them? If you just want to format a form, that can be done without using that experimental feature. > most of my repl outputs are single liners If trying to format output, would pprint suffice? I think I’m confused about what is desired here.
@U9A1RLFNV The clojure standard (as of my knowledge) is a single space between keys and values. What I want is for when pressing a key combination the formatting would become from <first image> to <second image>. Currently it is formatting as <third image>. Ideally it would work recursively for any nested maps
Wait, it seems @U9A1RLFNV understood something about the OP that I missed. You actually don't want the alignment? You want to basically pretty print the one-liner? I think zprint
can do this. If you add it as a dependency in your project you can use it at the REPL. See https://github.com/kkinnear/zprint/blob/master/doc/types/repl.md#maps
@seancorfield a new thread start for this one: > About the only thing I've managed to figure out that they have in common is that they have either large `case` statements or large hash map literals (as well as a bunch of other code). That sounds a bit like what I was suspecting when I asked if it is EDN files. Calva Highlight has performance problems with large forms. So maybe this is the problem you are experiencing. I'm thinking that even if you have disabled Calva's rainbow parens, we might not be short circuiting this processing. I could build a version of Calva were this is guaranteed to be fully disabled and you could test that one. We might also have similar problems in the general structural editing engine, but as a first test this might do.
Interesting. Sure. Happy to test any optimizations. And that HoneySQL code has been merged to develop now in case you want to try it out as a "canary" for such tests.
Updated link https://github.com/seancorfield/honeysql/blob/develop/src/honey/sql.cljc#L1364 (yes, very recently merged).
This file doesn't have particularly large or forms that should cause problems for Calva. With a quick test it behaved smoothly for me. So you have some repro steps I could try or are the problems more random/opaque for you?
I've not been able to establish repro conditions, and once it all locks up, I can't get to the logs to see what happened (I've tried looking in the LSP logs after a hang but there's so much data being logged -- including source code! -- that's it's hard to find anything useful). If you have suggestions on debug logging I could comb through, I'm happy to try after the next couple of hangs...