This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-08
Channels
- # asami (22)
- # babashka (35)
- # beginners (4)
- # calva (76)
- # cider (7)
- # clj-on-windows (89)
- # clojure (30)
- # clojure-europe (25)
- # clojurescript (10)
- # conjure (46)
- # fulcro (13)
- # gratitude (5)
- # lambdaisland (4)
- # lsp (13)
- # malli (5)
- # membrane (6)
- # nbb (1)
- # off-topic (11)
- # re-frame (2)
- # releases (1)
- # shadow-cljs (45)
- # xtdb (4)
I have a problem with CIDER and Shadow-CLJS. Don't know what's wrong. Maybe it's not CIDER's fault. The problem is that evaluating with cider-eval-defun-at-point
or cider-load-buffer
sometimes doesn't work. Then it starts working for no apparent reason, only to stop working again soon after. I recorded a gif of the problem. If you look at the minibuffer, when it says Loading <file>...
is when cider-load-buffer
is not working, and when it says SPC e t
is when cider-eval-defun-at-point
is not working. When it says => something
it is working. For some reason switching buffer to the REPL and back seems to make it work. Any ideas?
EDIT: Oh, now I noticed that cider-swich-to-repl-buffer
changes the repl type from cljs:shadow
to clj
, but when I type something in the repl it becomes a cljs:shadow
repl again. And while it's a clj
repl evaling doesn't work. Still, it is annoying.
Howdy all - I seem to remember on old lein projects, on jack-in I would end up with a user.clj file that was evaluated, or at the very least, the initial file I jacked in on would be loaded into the running cider repl session. I've built up a project from deps.edn, and that doesn't seem to be the case - how do I force loading of some files on initial cider connection? I'm feeling like it may be somewhat defined here https://docs.cider.mx/cider/config/project_config.html - with one of the clj flags
say you have user.clj in a dev
dir as usual.
then dev
should be in your deps.edn :paths
(for a :dev
alias or however you want to name it) and then make sure you activate that alias in cider

it's loadable via manual measures, or with a fn like:
(defun my-cider-connected-hook ()
(interactive)
(cider-switch-to-last-clojure-buffer)
(cider-load-buffer)
(cider-repl-set-ns (cider-current-ns))
(cider-switch-to-repl-buffer))
but it seems weird it doesn't load anything by default and I have to force the loadit's the :paths thing for sure, cider generally won't load code that isn't in your classpath (which is the correct behavior!)

Another QQ - when using .dir-locals.el, I want to let the cljs jack-in action know what REPL type so I don't have to choose 'figwheel-main', and subsequently 'dev' (env) at the REPL - what var would this be? I thought it was going to be:
(cider-cljs-repl-type . figwheel-main)
(eval . (cider-register-cljs-repl-type 'figwheel-main "(do (require 'figwheel.main) (figwheel.main/start :dev))"))
but that didn't seem to work out - I think the latter line may not even be correct (adjusted from cider doc page, but it seems more like maybe to define a brand new repl type)