This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-29
Channels
- # announcements (1)
- # biff (5)
- # calva (10)
- # cljdoc (4)
- # clojure (17)
- # clojure-europe (15)
- # clojure-norway (38)
- # clojurescript (53)
- # community-development (1)
- # cursive (2)
- # datomic (14)
- # fulcro (11)
- # funcool (1)
- # hyperfiddle (7)
- # introduce-yourself (2)
- # jobs-discuss (17)
- # missionary (7)
- # releases (4)
- # shadow-cljs (30)
- # slack-help (6)
- # specter (5)
- # squint (22)
hey folks! what are your strategies for reloading code to the REPL? I personally have a snippet of code that uses tools.namespace
to refresh all my changed code, which I setup to a hotkey so I execute it before running tests, or executing code to REPL
{
"key": "alt+l",
"command": "runCommands",
"args": {
"commands": [
"workbench.action.files.saveAll",
{
"command": "calva.runCustomREPLCommand",
"args": {
"ns": "user",
"snippet": "(require 'clojure.tools.namespace.repl)(clojure.tools.namespace.repl/refresh)",
}
}
],
},
"when": "calva:connected"
},
what do you guys usually do?I don't find a need for that. I eval every single change as I make it, often without even saving the file, so the REPL stays up to date. I see a lot of people get into trouble with reload/refresh workflows (blowing away namespaces that don't actually get reloaded again for weird reasons) -- and you really don't want to do this while you have an application running via your REPL since it'll kill all the state.
I have a hot key bound to some code that will "zap" just the current namespace so I can re-eval just that one file with ctrl+alt+c enter
-- but even that I only use very rarely. https://github.com/seancorfield/vscode-calva-setup/blob/develop/calva/config.edn#L121-L140
That repo has all my custom REPL snippets and my Joyride scripts, and fairly up to date key bindings and overall settings.
There's also some stuff in my https://github.com/seancorfield/dot-clojure repo for Portal / clojure.tools.logging integration and starting a REPL with whatever middleware is on the classpath.
I mostly use Integrant and have a hotkey bound to (integrant.repl/reset). Sometimes I just eval defun's o the fly with alt-enter when that will do.
Is there a way to edit the printing style outputted to the repl? I noticed recently that when using prn a ; is always placed before the output
There’s a setting to opt out of that protection. See https://calva.io/output/#about-stdout-in-the-repl-window
Thanks ❤️