This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (1)
- # aleph (1)
- # announcements (3)
- # babashka (39)
- # beginners (84)
- # calva (1)
- # cider (17)
- # clj-kondo (15)
- # cljs-dev (43)
- # clojure (132)
- # clojure-dev (1)
- # clojure-europe (4)
- # clojure-nl (7)
- # clojure-norway (4)
- # clojure-uk (22)
- # clojurescript (56)
- # clojurex (24)
- # crux (9)
- # cursive (11)
- # data-science (2)
- # datascript (33)
- # datomic (7)
- # docker (2)
- # figwheel-main (11)
- # fulcro (2)
- # jobs (3)
- # joker (29)
- # leiningen (3)
- # nrepl (4)
- # off-topic (11)
- # planck (4)
- # reitit (5)
- # ring (4)
- # shadow-cljs (205)
- # spacemacs (5)
Hey everyone, maybe a beginners question but as I'm setting up CIDER, I'm wondering if I'm using it wrong 🙂
I start by triggering a
cider-jack-in, then connect to it with
lein, and everything works fine, but if I, for example, create a new function, I need to invoke
cider-ns-reload to be able to use it (and see it in the autocompletion).
When using random IDE, if I write a function, it's automatically available as part of autocompletion.
Am I doing something wrong/missing some config, or is this expected behaviour because... REPL?
What most people do is to evaluate the function every time it has been updated. (Rather than reload the whole namespace.) Cider has a command for this. I have forgotten what it is named, but something with ”defun”.
I wonder if I should bother with hooking the saving of the buffer with
cider-ns-reload... In theory that would re-evaluate everything on every save, and I save frequently anyway...
@UQ5NR04L9 if you have any state in your namespace then reloading will reset that state each time. Reloading the ns is a little wasteful, when all you want to do is evaluate a function definition, function call or data structure.
With reload on save you could easily generate errors If you are refactoring something and press save mid way through...
I often evaluate the buffer if I have just opened a namespace and want all the functions in the repl
CIDER also highlights which function definitions have been evaluated in the repl with a mark in the fringe. This mark is removed as soon as you edit a function definition. A good way to keep track of changes
I keep meaning to ask @U051BLM8F how to make the evaluated function mark in the fringe a bit more obvious as I find it very useful 🙂
Yeah, expected behavior. The function didn't exist yet. The completion inspects the live environment, it isn't using static analysis.
hey, I'm just curious if something has been changed in
cider-browse-ns or I messed with helm config too much. not so long ago I could easily find desired namespace by providing any "part" of the namespace, eg: having
foo.bar.bazz ns it was enough to type
bazz to find the namespace. now, I have to add a dot, like
.bazz. is it how
cider-browse-ns works now?