This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-11
Channels
- # aleph (3)
- # beginners (42)
- # cider (219)
- # cljs-dev (39)
- # cljsjs (19)
- # cljsrn (3)
- # clojure (97)
- # clojure-canada (12)
- # clojure-dev (14)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-russia (1)
- # clojure-spec (3)
- # clojure-uk (140)
- # clojurescript (52)
- # clojutre (2)
- # cursive (2)
- # datomic (29)
- # docs (1)
- # duct (13)
- # emacs (19)
- # fulcro (8)
- # funcool (2)
- # graphql (26)
- # hyperfiddle (1)
- # luminus (9)
- # nyc (7)
- # off-topic (26)
- # om (21)
- # onyx (19)
- # overtone (1)
- # pedestal (4)
- # re-frame (10)
- # reagent (109)
- # ring (5)
- # rum (15)
- # shadow-cljs (120)
- # spacemacs (22)
- # specter (7)
- # vim (10)
@hagmonk what kind of emacs are you running? it looks like that's been deprecated but you should still have the info
(make-obsolete-variable
'find-tag-marker-ring
"use `xref-push-marker-stack' or `xref-pop-marker-stack' instead."
"25.1")
> etags.elI think this is a http://emacsformacosx.com build
emacs.d for doom just has this to say:
modules/config/default/+bindings.el
124: :i "C-]" #'company-etags
modules/feature/evil/+everywhere.el
62: etags-select
modules/feature/lookup/config.el
98:;; By default, `etags--xref-backend' is the default xref backend. No need. We'll
104: (let ((xref-backend-functions '(etags--xref-backend t)))
i don't understand who controls these files. maybe it is clobbered by doom? this is in emacs/lisp/progmodes/etags.el
.
one thing to try: in cider-jump-to
replace (ring-insert find-tag-marker-ring (point-marker))
with the suggested change: (ring-insert xref-push-marker-stack' (point-marker))
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath., compiling:(cider/nrepl/middleware/pprint.clj:1:1)
Cider nrepl does some source rewriting to prevent cider depend from interfering with project dependencies. Are you using git coordinates for that?
downloading a nightly build, because that's how I roll (and how I get into these situations)
i actually switched to linux from my beloved mac because i started building from source. and xcode said I could have gcc buti had to ask apple nicely to install them 😞
you should check out Alacritty, that's the only other thing I habitually build from source
you are in and out of many machines? I'm largely if not exclusively on my own all the time
oh I'd say the principal benefit is that it's basically a window manager for your terminal
there's also a modal selection you can drop in to, so you can scroll back in the buffer, search for text, highlight it, yank it … it's quite emacs-ish
it will be a super simple fix. i guess somewhere in my init that gets required so i've never seen it
I think something else in my stack was probably autoloading it, it has been on and off …
i put a comment on that issue and tagged bbatsov. i bet he sees this chat history at some point as well
This morning I've started getting
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.IllegalArgumentException: No matching ctor found for class java.net.InetSocketAddress
when starting up the repl with cider-jack-in-cljs
Yesterday evening things where working. Any idea what might have happened?
@vinai: it's explained above. I worked around it by setting cider-clojure-cli-parameters
to -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init {:middleware %s :port 0 :bind "::"})'
see other variants in today's slack history if this exact incantation doesn't work for you
Thank you @euccastro
I don't have it mapped to anything since I'm in spacemacs, but I think it's cider-jack-in with an universal argument (to override arguments to clojure
)
so it's basically the same trick as I say, but for a single cider-jack-in invocation
@euccastro That workaround worked great, thank you
@hagmonk Fixed. Likely I deleted the require accidentally during some refactoring. I’ve been restructuring the code a lot recently.
@euccastro That’s now patched upstream. An unfortunate side-effect of the auto-deployments having failed recently.
My build also worked yesterday and failing now. I’m receiving a different error though
error in process filter: progn: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)
apparently it’s not able to merge the alias map of my deps file, but I’m not able to spot any issues
one of my colleagues had a strange problem with jack-in-clojurescript
that was firing up only one REPL instead of two
she was using 0.18 snapshot, I made her switch to 0.17 stable to see if it was related to that and now it works fine
however to other people with 0.18 and the same config it seems to work 😕
we are using a custom repl type like
(eval . (cider-register-cljs-repl-type
'figwheel+integrant
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"))
which I think might be related> one of my colleagues had a strange problem with jack-in-clojurescript
that was firing up only one REPL instead of two
@andrea.crotti It’s not a problem, it’s the new standard behaviour of CIDER 0.18. 🙂
jack-in-clojurescript
now starts just a ClojureScript REPL (as many people as for this).
Btw, we wrote a ton of documentation of all those changes, people should started reading the changelog and the manual. 🙂
ah ok yes I started looking at the docs, but then my other colleagues told me it worked for them, so I got confused
not sure how it works for them then 😄
from the docs then there is no key binding by default for the new command to fire up both repls?
yes ok well I can just rebind it
I always need or both or just CLJ anyway
just curious, why would anyone only want the CLJS anyway?
unless you somehow have a cljs only project?
In my case, I happen to work on CLJS-only projects sometimes, I don't need the extra CLJ REPL
> from the docs then there is no key binding by default for the new command to fire up both repls?
See https://github.com/clojure-emacs/cider/pull/2369 for the ongoing conversation.
I'm using boot, along with boot-cljs-repl, so I typically use cider-connect to get a clojure repl for my project, and then in the rare cases where I want a cljs repl, use (start-repl)
in there.
So, I don't typically have a "cljs repl" and a "clj repl" -- they're one and the same.
I used to be able to switch to the clj repl fine from cljs files, but now I get the message user-error: No cljs REPL in current session (project-name)
I assume this is something to do with the connection changes in 0.18.0 .. is there a hook i can do something with to associate the clj repl with cljs files?
oh, i just started up a cljs repl with start-repl
, and was able to switch from a cljs file//. interesting.
> So, I don’t typically have a “cljs repl” and a “clj repl” -- they’re one and the same.
@eraad You can try the command like invocation in a terminal and try connecting with cider-connect
. Everything seems OK to me in your log, but likely something goes wrong with the server init if CIDER can’t connect to it.
@bozhidar this seems to be breaking quite a lot of people's workflow. I don't know enough about it to do this myself, but I suggest writing up a brief guide for folks who are coming to the channel and saying, "help, my CIDER just broke!" so that we can all have something standard to point them to (and take some of the repetition off your shoulders). Something short that just says, "here's what changed, here's what you need to change in your workflow."
(caveat: I just found out about it 15 min ago, so I'm still in the process of reading through it)
@eggsyntax I understand this change is probably somewhat surprising, but I think it’s for the better overall. Generally we plan to downplay the various jack-in-commands down the road and steer most people to the M-x cider
- when you see the list of all possible entry points all the confusion disappears IMO.
But yeah, we always knew that reworking the connection management was going to be painful. The release is not ready yet, the final docs will be even better.
Agreed. And to some extent folks who are choosing to use the snapshot are accepting some breakage (although a lot of folks, including beginners, end up on bleeding-edge by accident because spacemacs defaults to it). Just wondering if there's some good way to save you some time answering the same questions over & over, and to get the word out to the community that if they're gonna update to 0.18.0-SNAPSHOT they must read the new docs.
Maybe that alone is enough: "Your workflow broke? You probably updated to the new snapshot; either pin cider to melpa-stable, or go read http://docs.cider.mx/en/latest/managing_connections/ ." I'll default to telling people that for now.
I think that I can just added a few breaking markers to the changelog and hope people will actually read it. 🙂
I often miss the days when I had completely ignored this channel for a year and half.. And I’m strongly considering doing it again. 🙂
"add the breaking changes to the REPL startup messages" -- I think that might really help (although I find if I'm not paying attention, my eye skips right over startup messages once I've seen them enough times). "strongly considering doing it again" -- mental health / sustainable development comes first! Your input here is awesome, but the rest of us will muddle by 😉
> my eye skips right over startup messages once I've seen them enough times I'm pretty sure that's what will happen
I wish there was an easy way for the startup message to display 4 random defcustoms and their docstrings
> Allow evaling top level forms in a comment form rather than the entire comment form with cider-eval-toplevel-inside-comment-form
.
Can someone explain the rationale of this to me? Do I want to port this to other editors?
(comment
(def db (get-dev-database))
(def users (query db :users))
(let [user (first users)]
(make-admin user)))
Imagine something like this in the repl. When you execute cider-eval-defun
you will get nil
because that's what any comment
form evals to. This option checks to see if you're inside a comment form and if so readjusts what "top level" means.and you want toplevel to mean the first level inside of the comment form where your cursor is. ie, you want (def db (get-dev-database))
not (comment ...)
Yup, otherwise you have to keep finding the right spot to move the cursor to so you can call cider-eval-last-sexp
or something like that
exactly. you can take pains to put point right after the sexp or you can just eval as normal with this defcustom
Probably does not affect vim-fireplace users as much since you have a more general selection of what you're evaluating with text objects
but it might still be a nice touch
I see. So it doesn't "eval top level sexps inside a comment form" it "eval-top-level-form by selecting from a comment
first"
Available in emacs via evil-surround
IIRC
@dpsutton I was reading as taking:
(defn foo [])
and turning it into
(comment
(defn foo []))
which made no sense to me.It's redefining what "top-level-form" means, as opposed to evaluating the top level inside a comment
haha yeah. it takes the latter and realizes that you most probably want to think of it as the former
@bozhidar pointed out a problem in that this probably needs to live in clojure-mode so it can affect beginning-of-defun
rather than at certain calls
If you like vim-surround from the perspective of true text obj + operator, you'll love vim-sandwich. I recently made the switch, it's very good.
I only put two and two together after waking up this morning - init
is taking middleware, not handlers
Hi! May this be causing a timeout when trying to connect to a clojure-cli repl? I get this on the repl: ERROR: Unhandled REPL handler exception processing message {:op clone, :id 1} java.lang.IllegalArgumentException: Key must be integer at clojure.lang.APersistentVector.invoke(APersistentVector.java:294) at clojure.tools.nrepl.server$handle_STAR_.invokeStatic(server.clj:19) at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:16) at clojure.tools.nrepl.server$handle$fn__1005.invoke(server.clj:28) at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022) at clojure.lang.AFn.call(AFn.java:18) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
@hagmonk Likely you’re right. I’m having a very busy day and didn’t look carefully at the patch, but I was surprised by the handler part. I just assumed you tested this and knowing it only affects clojure-cli
users decided to merge it without fretting too much over it.
I tested starting the REPL, which worked, but the bug shows up as soon as you try to send a command to the REPL :( Totally my fault, I apologize. I can submit another PR with a test case that covers this more thoroughly
if I have clj and cljs repls, the code in (cider-interactive-eval "(some-clj-code)")
get evaluated in both of them. How to eval in just clj?
I've just switched back to 0.17.0, since I was having trouble with 0.18.0 after updating, but now I'm getting
Symbol’s function definition is void: cider-current-repl
Ring any immediate bells for anyone? Googling that only brings up two results, neither of which seems to fit.
it shouldn't be present if you've gone back to 0.17 unless you have custom code or maybe an updated helper package
Yeah, that latter is what I just started wondering. I'm gonna turn the debugger on & try to see where it's coming from. Thanks!
Hmm, call chain is
spacemacs/cider-send-ns-form-to-repl -> spacemacs//cider-eval-in-repl-no-focus -> save-current-buffer -> (set-buffer (cider-current-repl))
cider-eval-in-repl-no-focus
is from the clojure layer, not cider. So maybe the clojure layer has to be pinned as well :thinking_face:
Just to be sure I'm clear, you're saying that clojure
might use commands that require cider 0.18.0-SNAPSHOT
, right?
i have no insight into what the clojure layer of spacemacs does. I was just saying cider-eval-in-repl-no-focus
is not a cider command and they could use some new functionality without making a custom version
Turns out to be a spacemacs thing, details in #spacemacs in case anyone else encounters it.
Minor follow-up -- author of the original Spacemacs patch has submitted a new PR to SM so that the new cider-current-repl
will only be use if CIDER > 17, so this should hopefully be fixed soon for SM folks.
@bozhidar @richiardiandrea I have a new PR that fixes the cider-nrepl regression I introduced: https://github.com/clojure-emacs/cider-nrepl/pull/539
@eggsyntax This used to be named cider-current-repl-buffer
is 0.17.
Got it. Turns out to be a Spacemacs thing; it uses cider-current-repl
regardless of cider version.
@hagmonk I’ll take a look tomorrow, as I’m too tired today already. Seems @richiardiandrea already gave some feedback with respect to the boot plugin.
They added an alias for cider current connection o think. Should be easy to patch up spacemacs
@bozhidar thanks! looks like @richiardiandrea’s comment might have been from yesterday. There some strange test failures in unrelated areas - I can try re-running to see if they are intermittent.
Yeah my comment was not regarding the new add-on to the patch, unfortunately cannot check this now..after the 16th I will be able to...
[Fix #2342] Alias and obsolete variables after #2324
on CommitDate: Sat Jun 30 19:24:48 2018 +0200. cider-current-connection
went away and then came back i believe
& then the name change to cider-current-repl
is at https://github.com/syl20bnr/spacemacs/pull/10954/commits/3651c57253ebe1a68ca15cfde3a1ade1054a6840
Which is fine in general, but incompatible with CIDER 0.17.0.
right. so i believe the alias cider-current-connection
was added back so that older tooling and newer tooling had the same vocabulary
Hi! Please, can anyone provide clues on how to load deps from an deps.edn alias when doing clojure-jack-in? By default, they don´t seem to get loaded
@eraad: you can supply arbitrary command line arguments to clojure
by changing cider-clojure-cli-parameters
or, for a one-time thing, by prefixing your clojure-jack-in
with an universal argument (`C-u` in emacs or SPC u
in spacemacs)
Thanks @euccastro
np. I guess it would be most convenient to be able to set that in a per project basis, but I don't know how to do that