This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # architecture (9)
- # beginners (192)
- # boot (1)
- # bristol-clojurians (2)
- # cider (213)
- # cljs-dev (10)
- # clojure (195)
- # clojure-art (2)
- # clojure-austin (3)
- # clojure-belgium (4)
- # clojure-dev (4)
- # clojure-dusseldorf (1)
- # clojure-gamedev (9)
- # clojure-greece (21)
- # clojure-italy (27)
- # clojure-losangeles (2)
- # clojure-russia (1)
- # clojure-seattle-old (2)
- # clojure-serbia (1)
- # clojure-spec (114)
- # clojure-uk (136)
- # clojured (2)
- # clojurescript (100)
- # community-development (19)
- # core-async (12)
- # cursive (7)
- # duct (1)
- # figwheel (7)
- # fulcro (96)
- # hoplon (4)
- # jobs (2)
- # lein-figwheel (28)
- # leiningen (2)
- # luminus (14)
- # lumo (3)
- # off-topic (11)
- # om-next (2)
- # pedestal (10)
- # planck (11)
- # portkey (2)
- # proton (1)
- # protorepl (19)
- # re-frame (27)
- # reagent (12)
- # shadow-cljs (82)
- # spacemacs (42)
- # specter (15)
- # sql (3)
i can’t for the life of me get
cider-find-var to work, just says
Symbol 'blah/foo' not resolved no matter what I do, I’m surprised since cider should have access to the jvm and language object model
@iwannaseethelight 1.) did you compile the code you're trying to resolve a symbol in? 2.) If you did, how did you start the nrepl, and is there a warning at the top of the repl buffer
hey @tanzoniteblack, I just navigated to my
lein project, booted up emacs, and executed
so that's a yes on the first one then? That you've run
cider-load-buffer or something similar to load the code in the running repl environment?
@iwannaseethelight I don’t think that
cider-find-var can discover code you haven’t loaded.
(the-ns 'your-missing-namespace) doesn’t work in the REPL CIDER won’t be able to find it either.
No it doesn’t.
cider-find-var works great once you’ve loaded your code and are deving.
Remember, CIDER is a feature layer for REPLs with the expectation that your code is loaded into Clojure all the time.
I guess I thought that when you jack in, it starts up the jvm, loads your project, and communicates with it over the repl
i thought that find var would just ask the jvm about a symbol / function and return a result to you
So think about it this way. When you “boot a REPL” you’re telling the JVM “here’s my main(), go run that”. In this case, your main is the nREPL entry point, so it loads nREPL and Clojure and anything else required to stand the server up.
The JVM only loads code when it needs to, so until you go explicitly
(require 'your-ns) or something else Clojure, nREPL and the JVM are completely oblivious to the fact that it’s valid code.
So if you open up one of your scripts and
C-c C-k to compile and load the namespace, then it’ll be loaded into your nREPL connection and you’ll be able to explore it with
so you have to load a file, jump to var, load that file, jump to another thing ..
No. You load one file, and that causes all of its transitive dependencies to become loaded, and then you can go wherever.
so if i load file a, and it imports namespace b, which imports c, c is implicitly loaded when a is
clojure.core/*loaded-libs* is a collection of all the namespaces that Clojure thinks it has loaded.
user.clj is a magical file that
clojure.lang.RT loads before it goes and does whatever you asked it to such as booting nREPL. Typically people will put it in a
dev directory and use it for development utilities.
oh on that note haha - i notice that cider seems to create a
user ns, which sucks because this huge project declares a
user ns so none of the autocomplete works for
user unless it’s fully qualified ..
jesus, I just discovered
M-,, i’ve been a hardcore emacs user for 10+ years, how have I not know about that command
well i have no problems with a
user ns but unfortunately they declare things like
a.b.c.user, and if you type
user/.. nothing happens unless you fully qualify
in other words, if i’m in like
thebigproject.main, and it imports
a.b.c.user :as user, and you then type
user/.. at the repl or in code, nothing happens
Being “in” that namespace != it being loaded FWIW. You can
C-c M-n to namespaces that aren’t loaded yet.
🤷 recompiling a namespace is super cheap I usually just
C-c C-k all the time just to be sure.
Yeah that probably means that you’re “in” the namespace, but the namespace hasn’t been loaded so it’s empty.
No worries. Being “in” a namespace means that
clojure.core/*ns* points to the namespace named
thebigproject.main. Changing current namespace to
(in-ns 'thebigproject.main) will create that namespace and set
*ns* appropriately, but it won’t load any code in the file that corresponds to
This means that you’re “in” the namespace, but the
(ns) form that defines all your
(:require ... :as ...) hasn’t been executed
Because they aren’t the aliases they’re the fully qualified names I think based on what you’re saying.
I’m a contributor to CIDER and a bunch of other stuff but I don’t maintain anything worthwhile.
i was curious, there’s a
helm interface to the repl history etc, but there doesn’t seem to be for
cider-find-ns et al
oh scratch that, there is for
cider-find-ns but not for jump to symbol i guess, because it uses what’s under point?
There is a separate REPL - figwheel was how people did that song and dance last I checked but I don’t have much experience on that side of the house.
if anyone else happens to show up in this channel, what’s the proper way to boot up a clojurescript repl, and can you have both a clojure and clojurescript repl going at the same time in emacs?
you can have both going; let me see if I can find a good readme on getting that set up right
https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl ; if you already have figwheel set up in the way specified in the beginning you can jump down to https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#integration-with-emacscider
and as an FYI, while that example suggests setting the emacs variable
cider-cljs-lein-repl in your
.emacs.d/init.el; I'd actually recommend putting a file called
.dir-locals.el in the root directory of your project (i.e. next to
project.clj) with the contents:
This accomplishes the same thing, but sets this variable per project, instead of globally
((nil . ((cider-cljs-lein-repl . "(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"))))
I need some help on this question https://emacs.stackexchange.com/questions/38857/the-formatted-string-passed-to-cider-eval-function-error. Can confirmed the problem is on Elisp CIDER side. The problem is as this comment said https://emacs.stackexchange.com/questions/38857/the-formatted-string-passed-to-cider-eval-function-error#comment61517_38857
Umm... Going offline now for family time, but it's a built in emacs thing, no special package https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
I'm brand new to emacs using spacemacs and cider. I'm running into this issue where when I send an expression for evaluation at the repl, one of my CPU cores jumps up to 100% usage, and spacemacs freezes totally. Killing the process, restarting, and evaluating that same expression seems to work fine (making me think I didn't necessarily create an infinite loop in my code). Any ideas?
So it happens once in a while, but not every time? And not necessarily the same expression?
I feel like I’ve seen a similar odd long pause “at first” before, but I can’t recreate and I’m not sure what the issue was. I think I just upgraded around then when new versions came out and it magically vanished.
Someone put an issue that they saw this when they ran lein repl outside of a project
Don't have time to commit as much due to school and full time job so I try to at least follow along
Thanks for the input, @dpsutton , @gonewest818. I'm less confident now than I was initially that I'm not just creating infinite loops. In any case, discovering that spamming C-g quickly remedies things has got me back in business for now. I'll keep a watch of that issue and keep looking around if the problem persists.
Another thing to watch out for is printing excessive output to the repl. There are settings you can use to limit repl output (`*print-length*` and
*print-level*), and starting with CIDER 0.17.0, I’m pretty sure CIDER will override those settings even if you’ve configured them in
~/.lein/profiles.clj. See https://github.com/clojure-emacs/cider/issues/2160
But if you’re using CIDER 0.16 and you haven’t configured those settings, then I would watch for things that print long lists to the repl. (e.g.
(range N) with a large N, or an infinite
@triss https://clojurians.slack.com/archives/C03S1KBA2/p1519255131000429 set the emacs variables
(or one of the other options: https://github.com/clojure-emacs/cider/blob/master/doc/configuration.md#pretty-printing )