Fork me on GitHub

Is there any way to control the format of line comments in Calva? Weirdly it seems to be specified as double semicolon here: but in reality my VSCode just inserts a single semicolon. I poked around the source a bit more wondering if it would be possible to introduce this as a config item but struggled to find my bearings. I also wondered if anyone had any pointers on where to look in the source code if I wanted to recreate paredit style bracket-aware commenting, which shifts closing brackets to the next line when commenting a line. Sorry for the very basic questions, I'm just keen to recreate some Emacs functionality my brain is now hardwired to expect!


I'm glad you've reported this! We were discussing this earlier today. See this issue: Please comment your system details so we can track down the cause.


(Seems to only be happening on certain systems, but not sure of the specifics)


It also seems to have started to happen recently. I suspect an upstream bug.


yes, it seems to be an upstream thing. Trying to find the relevant commit(s)


Let’s. However, as I see it, the bug isn’t that the default extension applies the wrong comment configuration. It is that it overrides configurations from extensions that the user installs. The comment config is the only symptom we have discovered so far, but I think we are up for discovering more unpleasantnesses.


@UTF99QP7V a PR with that behaviour would be highly welcome. I’ve been wanting to add it for very long. Best way to implement it is probably by creating a command and default keybind it to ;. Like the strict mode backspace is implemented:


I’m short on time right now, but will be super happy to guide you with this.


Does anyone know if VS Code requires something like signing a contributors agreement?


I did google it 🙂 their "how to contribute" page doesn't seem to mention it, which is somewhat surprising for open source by BigCorp


I don’t think they do. I almost got a PR merged some year ago. The reason it didn’t happen was that the team had fixed the same issue before they saw my PR. Never a mention of any contributors agreement.


I’ve also updated the syntax grammar (via the Atom repo). Even if it took them half a year to look at my PR, it was merged without me signing anything. And this was after MS had bought Github.


they merged! that went much faster and with much less friction than I expected


There’s a reason why they have so many contributors to vscode. 😃


Oh I didn't know VSCode has their own mode for Clojure, I thought this was part of Calva :)


Well, if you have Calva installed it all should come from Calva. I don’t think there is anything we don’t override. Or, well, we used to override. I really hope the VS Code team fixes this mess quickly!


Dear Calva friends: I’ve just filed a bug report issue on VS Code about this comment issue. Please help with making it more visible to the VS Code team by voting on it with the “Thumb up” reaction.


So if some of you have some time (I won’t) it would be nice if some Calva people joined this and helped @andyfry01 use Calva in an idiomatic way. I’d like for this 12 startups project to become a success story for Andy as well as for Clojure and Calva. 😍


@pez are you also helping on clojureverse ?


Helping how? Calva support? I do that wherever I see someone reach out. 😍

❤️ 9

Hi @pez and others, have you ever seen this error when jacking-in?

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.6"}}}' -A:dev:test -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
WARNING: When invoking clojure.main, use -M
Execution error (SocketException) at (
Protocol family unavailable
It shows up in the terminal.


Ok I think I see what's going on - my app embed an nRepl server already so I don't need to launch it again via nrepl.cmdline


Actually no, probably I am running into something similar to this:


a .nrepl.edn like this one solved

{:bind "localhost"}
Is there a way to pass parameters to nrepl.cmdline while jacking-in by any chance?


I think so. Hmmm... Maybe by defining a profile that has a main option.


ah that's a good idea - I will check the docs 😉


you helped me to find a nice icon to show the user he/she can reach the next page

❤️ 3

and it looks very well

calva 3

How do you get Calva to create the repl using a specific jdk? I have some java files that need to be compiled using jdk > 11. But my calva repl refuses to import them because it launches the repl using java 8. Do I have to change my system jdk for Calva to launch my repl using jdk 11?


@cdimara I think you could use the calva.jackInEnv setting for this. That or start code from a terminal where you have the right jdk configured.


ah then connect to it via port number?


The process that starts your project is what needs to be using the right jdk. Calva can start it, using the Calva: Jack in command, in which case it will need the right environment. Then Calva will also connect to the REPL automatically. Or, you can start your project outside Calva and use Calva: Connect to connect the REPL.


Struggling here with how to describe it, but … in any case once your project is running, Calva is just a client, it is not Calva that imports those java files, it is your app that does that.


I think I get it. Also just saw this from the troubleshooting page:

Environment Variables Are Not Readable From REPL

If you've added environment variables in your OS, such as in your ~/.bashrc file (Linux), in order for them to be read in a REPL created by Calva's jackin command, VS Code must be started from a shell where the environment variables are defined. For example, if you can open a bash terminal and run echo $SOME_VAR and see the value there, then open VS Code from that terminal with code <project path>.


Yes, can you post the link to that page?


Haha, OK. I’m a bit tired, didn’t realize it was from the Calva docs. 😃


So I was able to use sdkman to switch up the jdk i'm using (`sdk use java 11.0.9.hs-adpt`) then launch from that shell using code . . That appears to have worked! Thank you!


Awesome. I just love sdkman. A project with a logo like that just have to be super duper. 😃


its banannas useful


finally feels like java is moving into the 21st century


virtualenv for java? Um, yes please!


Indeed. I wish it was even more like virtualenv. That is the kind of control I want over my project’s environment and dependencies.