This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-04
Channels
- # announcements (37)
- # babashka (4)
- # beginners (85)
- # calva (12)
- # chlorine-clover (4)
- # cider (20)
- # cljdoc (6)
- # clojure (37)
- # clojure-europe (44)
- # clojure-norway (46)
- # clojurescript (47)
- # conjure (1)
- # cursive (44)
- # datomic (23)
- # docs (2)
- # hyperfiddle (66)
- # introduce-yourself (4)
- # malli (16)
- # off-topic (7)
- # pathom (6)
- # portal (20)
- # re-frame (4)
- # releases (1)
- # shadow-cljs (56)
- # squint (1)
- # xtdb (9)
Hi, probably a noob question here: I'm trying to use the calva.autoEvaluateCode
feature but, whenever I add it to my settings.json, jack-in
simply stops working. This is what I try adding (which should only be the default code):
"calva.autoEvaluateCode": {
"onConnect": {
"clj": "(when-let [requires (resolve 'clojure.main/repl-requires)] (clojure.core/apply clojure.core/require @requires))"
},
},
Looking at vs code logs:
2023-08-04 18:04:48.566 [error] TypeError: Cannot read properties of undefined (reading 'clj')
Can you tell me what am I doing wrong here?My settings.json
file has this:
"calva.autoEvaluateCode": {
"onConnect": {
"clj": "(when-let [requires (resolve 'clojure.main/repl-requires)] (clojure.core/apply clojure.core/require @requires))",
"cljs": "(try (require '[cljs.repl :refer [apropos dir doc find-doc print-doc pst source]]) (catch :default e (js/console.warn \"Failed to require cljs.repl utilities:\" (.-message e))))"
},
"onFileLoaded": {
"clj": null,
"cljs": null
}
},
(Calva added that itself -- what version of Calva are you running @U04EUSW0ZUG?)
@U04V70XH6 It's 2.0.382 here.
I have the same code as you under my default settings.json
file, but for some reason when I add this to my user settings.json
, it causes the issue.
The above is from my user settings.json
so I'm not quite sure what you mean about a "default" settings file?
I am able to re-create this in my user-level settings.json, and it seems to be resolvable by adding the onFileLoaded key. This shows a warning, but I'm still able to start the REPL
Ooh, that was the problem. I assumed I needed only to include the property I was overriding (in this case, onConnect
), so I had not included onFileLoaded
. Including the entire setting once again in user settings.json
did the trick, thanks
Is anyone offering Calva training?
Not that I'm aware of. Do you have a desire for this? Would it be 1 on 1 or a training for a group? Is this corporate-related or otherwise?
Oh hey, sorry, just saw this. It would be for a corporate team, maybe 6 people or so. I'm a long-time clojure hacker, but I'm new to Calva and VS Code, and we have alot of newbs who are using it. I would like to give them a hand on using vs code, git, clojure repl driven dev, running tests easily etc.. Thinking a single session
Aside from a live training session, you might find the CalvaTV YT channel helpful. See the playlists: https://www.youtube.com/@CalvaTV/playlists