Running Clojure
The default to run Clojure is lein exec and should be cd $dir && lein run
What the difference of lein exec and lein run?
lein exec fails in VS code, lein-exec is a third party extension, but lein run in the correct directory runs the currently open file as you'd expect.
Quick fix is to add
"code-runner.executorMap": {
"clojure": "lein run"
}
to your user or workspace settings
Quick fix is to add
"code-runner.executorMap": { "clojure": "lein run" }to your user or workspace settings
thanks for this workaround, but now leiningen complains about:
no :main namespace specified in project.clj
any idea there?
so I finally found a "working" workaround by hooking up the official clj/clojure tooling instead of leiningen, like this:
"code-runner.executorMap": {
"clojure": "powershell -command clojure -M \"$fullFileName\""
}
and it works like a charm now, well a charm that takes 2 seconds to load every single time, but still … in fact if you don't want to wait 2 seconds every time, you can use babashka instead:
"code-runner.executorMap": {
"clojure": "bb"
}