This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-28
Channels
- # announcements (2)
- # babashka (21)
- # beginners (24)
- # calva (9)
- # cider (7)
- # clj-kondo (12)
- # clojure (116)
- # clojure-europe (5)
- # clojure-korea (2)
- # clojure-norway (3)
- # clojure-poland (1)
- # clojure-spec (5)
- # clojurescript (12)
- # cursive (12)
- # datomic (8)
- # google-cloud (4)
- # honeysql (16)
- # java (18)
- # lsp (10)
- # missionary (14)
- # polylith (12)
- # re-frame (13)
- # releases (4)
- # shadow-cljs (10)
- # sql (10)
- # testify (2)
Hi! I’ve been made aware that I can configure Calva to run a function in my REPL with a key binding, which is awesome:
{
"key": "ctrl+alt+c alt+enter",
"command": "calva.runCustomREPLCommand",
"args": {
"snippet": "(nextjournal.clerk/show! \"$file\")"
}
},
Is it possible to configure calva do three things after each other on one key binding press?
Specifically, I’d like to bind some hotkey (eg Ctrl+Enter
) to first save all open tabs, then run a function (`clj-reload.core/reload`), then run another function (`user/tcr`).Hi! I think you are looking for runCommands
https://blog.agical.se/en/posts/vs-code-runcommands-for-multi-commands-keyboard-shortcuts/
Like to ask, how can I resolve these issues in latest vscode + calva (if not mistaken, generated by macros for hiccup).
I think there is something wrong/insufficient with the dependencies configuration in the project. Or clojure-lsp or clj-kondo are running from stale caches or something. You could try stopping clojure-lsp, and remove .lsp/.cache
and .clj-kondo/.cache
, then start clojue-lsp again. If that doesn’t help, it probably is something with the classpath.
@U0ETXRFEW I have deleted those 2 .cache folders and also restart the clojure lsp server (or exit vscode and open again). Same issue. How do I fix this with classpath? This only happens to hiccup.
Hard to tell without knowledge about your project (and I am far from an expert on these things.) clojure-lsp uses the project configuration to figure out the classpath. If it’s a deps.edn project it will run something like clojure -Spath …
. If it’s Leiningen then it will use whatever is the lein
equivalent. Or shadow-cljs
if that is how dependencies and classpaths are managed. Since it is only hiccup that causes you these troubles it could be something with how that dependency is specified.