Fork me on GitHub

Not sure if this has been discussed before, I arrived at my computer being warm to the touch, and I found a few rogue clojure-lsp + Electron processes consuming CPU. I very often "Reload Window" to fix the buggy neovim plugin, but it seems this might be leaving processes hanging? The only way to fix was to manually kill the rogue lsp process, and then disabling/enabling Calva to fix the Electron issue.


I will keep an eye on this in the future, and see if I can deduce a pattern


I have run into this occasionally but I have not been able to figure out what causes it... I only tend to Reload Window when I need to update extensions... but I keep VS Code running for days (sometimes weeks) and reload a few times a week...


One curious thing I found is having 3 electron processes with a copy of clojure-lsp each under it. Under normal circumstances there's a top level Electron process with a single Clojure-lsp.


Not seen this. But also haven't been on the look. I reload window tens and more times a day, so if this is the cause I have a good chance to see it.


Does your laptop have fans @U0ETXRFEW? Mine doesn't so the only tell is actually that it's getting warm. When it's docked on my desk I don't really notice. I noticed this morning as I flipped the screen on and it felt unusually warm.


Yes, it has fans. I've only ever heard them run once, since I got the machine. I have the computer on my lap all the time and it never goes warm. Right now I have 9 VS Code windows I open. I see tons of Electron processes. But they are all grouped under 9 main Electron processes. I see 10 clojure-lsp processes running, 9 of which are grouped under each main Electron process. The 10th is owned directly by Code, has a total of 0 CPU time and consumes only 273Kb of memory. My computer is rather freshly rebooted (some 2 weeks ago) and I restarted VS Code yesterday (after having run it w/o restart since the computer reboot). I very seldom restart VS Code. Only to upgrade it.


I also have 11 java processes. 5 of which are under the Code Helper (Renderer) process running my work project, where I have five different shadow-cljs processes running. (It's a monorepo and I work with a library serving several of the projects there.)


I just opened a new VSCode window, in a Node.js project. It shows up as a separate Electron process, which has a clojure-lsp child. It shouldn't have though, why is it starting a clojure-lsp process in a Node.js workspace? There's a clojure file buried within a subdirectory, could that be the case?


What kind of Clojure file is it?


Are you running latest Joyride?


It has a .clj extension - but there's no deps.edn or anything like that on the workspace. Yes, I'm running the latest Joyride (I restarted VSCode this morning so presumably it's got the new versions). I can of course disable Calva and Joyride in the workspace...


You can disable clojure-lsp in the workspace.


Hm, how can I do that? No worries though, this is a legacy pure JS project that I experimented in adding a browsertest in Clojure, but it never went anywhere, so I'm happy disabled Calva/Joyride inside that workspace.


It's Joyride starting Calva since yesterday. Or rather the user_activate.cljs script.


There's a setting for clojure-lsp auto-start.


Calva doesn't by itself autostart unless it find one of there:



Or, when you open a Clojure file.


Cool, so it's joyride that's starting Calva. One less mystery 😄 I'll keep an eye to see if this happens again.


It's the default user_activate.cljs script. <-important distinction.


Ah. I'll see about that, I haven't had a chance to update my scripts to the new goodies.


Yesterday's change changed the activation scripts to be named user_activate.cljs and workspace_activate.cljs. So your activate.cljs files are not being run on startup, and you're running with the default user activation script. The workspace one is not installed automatically, but you can install it from the Joyride: Run Workspace Script... menu. Here in a workspace where I haven't done that and thus the old activate.cljs script there is demoted to a regular script.


I'm doing the exercise from How can jack-in, run the exercise and evaluate form?


I just lein koan run rather than jacking in


In that case I don't get a REPL. I want to do the exercise and also have a REPL so that I can play around.

Luke Johnson01:06:00

According to the, you can start your REPL like any other leiningen printed with lein repl. Then you can jack in with your editor of choice.


If you want to use Calva for this and evaluate forms from the editor, you can clone the clojure-koans repo, then open it with VS Code, then run Calva’s jack-in command. Once connected you can evaluate forms from the editor. I’m not really familiar with clojure-koans, but trying to evaluate a whole form that uses the meditations macro does not work for me. I don’t know if there’s something that needs to be changed in the code to make that evaluation work. But you can evaluate the individual forms within the meditiations form.


Has anyone here used talon + with Calva for voice coding in Clojure?

Robert A. Randolph13:06:46

I have not used Cursorless, but I do use talon+calva and talon+emacs


Okay, I use Talon + Calva too but have only created a few custom commands so far. Plan to add more. Was exploring cursorless but it doesn't play very well.

Robert A. Randolph13:06:36

I find using a Vim mode to be extremely well suited to Talon personally


Okay.. any recommendation for a vim mode for VsCode? Found but if there's something that you find works well with Calva.

Robert A. Randolph13:06:52

That's what I use, and I've changed nearly all my calva shortcuts so it works fairly well.


Cool, will check this out.


I’m not a vim user but you might find this page in Calva’s docs useful:


Hi, using Calva I found that the default indentation for functions call use 1 space instead of 2 spaces. I quickly passed the docs and read a bunch of issues but didn't find a way What it does by default is

 (format "print time"))
instead of
  (format "print time"))
Didn't find anything also in the Calva settings


1 space is idiomatic Clojure so this seems right to me for function calls.


(well, that and the next section)


right, I think the entire team used some different config with Emacs 😞 How can I then disable automatic indentation, and just indent the single form?

Luke Johnson01:06:09

If all the code is formatted the same, it's likely your team uses a formatter like cljstyle to keep things consistent. Search the repo for cljstyle or cljfmt to get a better idea.

👍 1

There might be a cljfmt configuration in the project. If so you can use that with Calva.


Check out At the end of that page there is an example config that will format all function calls to 2 spaces. (It will also not care about ”hanging” indents and such, which might or might not be what is used in the team. The point is that you might be able to get Calva to format things according to the project's style.)

🙌 1

Sorry, for the late reply. No there's no cljfmt configuration unfortunately. I will maybe ask the team about the formatting standard. Thanks @U0ETXRFEW!


Cool. I'm curious about what the project is using for standardizing formatting. Mostly for my orientation around what's in practice out there.


ok I found a script with lein-cljfmt "0.6.4" inside and default configuration. Not sure if has been run recently. Most of them use doom emacs+cider so I suspect parinfer-rust to be the default for that


Wouldn't parinfer-rust also be configurable around the formatting to use? What do you mean with ”default configuration”? That there is no cljfmt config in the script, or that there is one? Is it a Leiniggen project? (If so, sometimes the cljfmt config is inside project.clj).


Sorry, I missed your reply. I just found this script into the project


export RUN_CMD_PROFILE="$(cat <<EOF
  :plugins [[lein-cljfmt "0.6.4"]]
  :cljfmt {


if [ -z "$1" ]; then
  cat "$RUN_CMD_DIR/desc"|tail +2
  exit 1

exec lein with-profile +run cljfmt "[email protected]"
that's it. No other formatting configuration found 😐😞


And yes is a Leiningen project