This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-28
Channels
- # aleph (1)
- # announcements (16)
- # bangalore-clj (1)
- # beginners (78)
- # cider (109)
- # clara (3)
- # cljdoc (6)
- # cljsjs (3)
- # clojure (209)
- # clojure-dev (11)
- # clojure-europe (1)
- # clojure-france (9)
- # clojure-italy (13)
- # clojure-nl (3)
- # clojure-spain (2)
- # clojure-spec (19)
- # clojure-uk (50)
- # clojurescript (41)
- # clojutre (2)
- # core-async (45)
- # cursive (2)
- # datomic (14)
- # emacs (6)
- # figwheel-main (1)
- # fulcro (101)
- # graalvm (1)
- # graphql (3)
- # jobs-discuss (3)
- # kaocha (12)
- # leiningen (8)
- # music (4)
- # off-topic (47)
- # parinfer (8)
- # pathom (17)
- # pedestal (53)
- # re-frame (47)
- # reagent (22)
- # reitit (4)
- # shadow-cljs (49)
- # tools-deps (87)
Is there a way to quickly navigate to a var that is defined in the current namespace?
I mean by typing partially the name of the var
hello, I do cider-jack-in-clj&cljs
. I have several questions:
(1) I see logging output from the clj repl in the cljs repl. Is that expected?
(2) If I close the cljs REPL only, and then do cider-jack-in-cljs
figwheel-main tells me that the address (the port) is already being used. I thought I closed it already!
(3) What does it mean for 2 REPLs to be “siblings”?
imenu looks awesome! Thanks @dpsutton. How does the integration with CIDER works?
emacs understand Clojure?
I saw and it looks great. I was just curious to understand how it works
from clojure-mode: (add-to-list 'imenu-generic-expression '(nil clojure-match-next-def 0))
(re-search-backward "^[ \t]*(\\([a-z0-9.-]+/\\)?\\(def\\sw*\\)" nil t)
so its regex based
I also saw once a CIDER buffer with the symbols of the current namespace but I don’t remember how to open this buffer
Is there a quick way to browse the current namespace?
How can I add a keybinding for that?
(spacemacs/set-leader-keys-for-major-mode 'clojure-mode "hc" '(funcall-interactively 'cider-browse-ns (cider-current-ns)))
?I tried this ^ but It din’t work @dpsutton
I have still an issue. I am using helm-cider-mode
When I run (cider-browse-ns (cider-current-ns)))
, it opens a buffer with the list of all the namespaces
I think I found the issue in the code of helm-cider-mode:
defcustom helm-cider-overrides
'((cider-apropos . helm-cider-apropos)
(cider-apropos-select . helm-cider-apropos)
(cider-apropos-documentation . helm-cider-apropos-symbol-doc)
(cider-apropos-documentation-select . helm-cider-apropos-symbol-doc)
(cider-browse-ns . helm-cider-apropos-ns)
(cider-browse-ns-all . helm-cider-apropos-ns)
(cider-browse-spec-all . helm-cider-spec))
"Alist of CIDER functions and Helm versions replacing them."
:group 'helm-cider
:type '(alist :key-type symbol :value-type symbol))
https://github.com/clojure-emacs/helm-cider/blob/master/helm-cider.el#L428
The command you mentioned opens imenu which is string based. I prefer (cider-browse-ns (cider-current-ns))
@stathissideris It means they belong to the same CIDER session (usually different REPLs connected to the same server).
> (2) If I close the cljs REPL only, and then do cider-jack-in-cljs
figwheel-main tells me that the address (the port) is already being used. I thought I closed it already!
I’m guessing that killing the nREPL connection doesn’t kill figwheel or something like this.
Thanks @bozhidar I’ll try and demonstrate (1) by setting up a minimal project
I’m having some issues to get cider-connect-cljs
to work with shadow-cljs
– the REPL connects fine, but its type is clj
which means the buffer integration from cljs buffers doesn’t work
If I manually change the REPL type using cider-set-repl-type
to cljs
it’ll work, but the type reverts back to clj
after each command I send
(also, cider-jack-in-cljs
seems to work fine, so it seems to be related to cider-connect-cljs
specifically)
Getting some RuntimeException Unable to resolve var: cemerick.piggieback/*cljs-compiler-env* in this context
errors for previous versions
Glancing over the changelogs a lot of versions around .47-.50 seems related to piggieback stuff
.48 seems to be broken, so https://github.com/thheller/shadow-cljs/commit/a4fc198a2296fdc53590b28d7afaefec03909e0e could have introduced the breakage, I suppose
If I’ve understood things correctly, shadow-cljs doesn’t use piggieback at all, but mimics it under the hood
cemerick.piggieback
is rather old and shouldn't be used anymore? are you on an old cider version? or nrepl?
Honestly not sure how I’d go about checking my deps tree, still pretty new to the entire clj(s) ecosystem
❯ clj -Stree | grep nrepl
nrepl/nrepl 0.6.0
refactor-nrepl/refactor-nrepl 2.4.0
cider/cider-nrepl 0.22.0-beta12
Hmm, I’m assuming you must have something that’s depending on the old piggieback
, otherwise I can’t imagine how you’d be getting such an error.
Nope, but I got that error when I reverted the shadow-cljs version to older releases
@warnsberg you should be on the latest shadow-cljs release (2.8.52) or something before all the nrepl mess
But I think my real issue is as I described initially, with newer releases (> 2.8.48) CIDER seems to think that my cljs repl is a clj repl
But I’m seeing the issue with CIDER interpreting my REPL as a CLJ repl instead of a CLJS repl, so I cant send commands from my cljs buffers
but the cider detection seems to be broken somehow. @manuel reported that yesterday too
But things like (js/alert "foo")
works just fine, so the REPL is indeed connected correctly
If I manually change the REPL type to cljs
it will work for a single command, but then revert back to clj
we should probably add an "ignore state tracker" option to CIDER for these annoying bits that come up. This shouldn't be a showstopper beyond the one time it falsely responds
(defn- cljs-env-path
"Returns the path in the session map for the ClojureScript compiler
environment used by piggieback."
[]
[(if nrepl-piggieback?
(resolve 'piggieback.core/*cljs-compiler-env*)
(resolve 'cider.piggieback/*cljs-compiler-env*))])
this could probably be smarter as well.cider.piggieback/*cljs-compiler-env*
this should be bound. the other one doesn't exist
oh i was totally misreading this as cemerick vs cider rather than current vs future planned version
@thheller not sure if this help but since I've had the issue as well I can add than if I manually change the repl-type to cljs, then call cljr-clean-ns, the repl-type switches back to clj, and this is the stack trace that changes it back:
Debugger entered--setting cider-repl-type in buffer *cider-repl ~/my-project:localhost:33673(cljs:shadow)* to clj:
debug--implement-debug-watch(cider-repl-type clj set #<buffer *cider-repl ~/my-project:localhost:33673(cljs:shadow)*>)
cider-set-repl-type("clj")
cider-repl--state-handler((dict "changed-namespaces" (dict) "id" "18" "repl-type" "clj" "session" "df02492d-a0c7-4553-b463-c45237d0c7c1" "status" ("state")))
run-hook-with-args(cider-repl--state-handler (dict "changed-namespaces" (dict) "id" "18" "repl-type" "clj" "session" "df02492d-a0c7-4553-b463-c45237d0c7c1" "status" ("state")))
nrepl-client-filter(#<process nrepl-connection> "d2:id2:182:ns17:app.camera.screen13:printed-valuei1e7:session36:df02492d-a0c7-4553-b463-c45237d0c7c15:value17:app.camera.screened2:id2:182:ns17:app.camera.screen13:printed-valuei1e7:session36:df02492d-a0c7-4553-b463-c45237d0c7c15:value17:app.camera.screened2:id2:187:session36:df02492d-a0c7-4553-b463-c45237d0c7c16:statusl4:doneeed18:changed-namespacesde2:id2:189:repl-type3:clj7:session36:df02492d-a0c7-4553-b463-c45237d0c7c16:statusl5:stateee")
all I understand is that the repl seems to advertise itself as being of repl-type" "clj" and cider keeps changing it back to that?yeah the track-state
middleware is responsible for that. my changes seem to have messed with that.
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
yeah I always have this prompt in the repl btwwith 2.8.45, removing clj-refactor from deps I get a cljs repl with the right repl type
2.8.52/no clj-refactor in shadow-cljs.edn (but still get warning about clj-refactor middleware in repl): wrong repl type
just stick to the older version. don't have time to figure out what exactly broke right now.
ok, definitely this commit though https://github.com/thheller/shadow-cljs/commit/a4fc198a2296fdc53590b28d7afaefec03909e0e
my guess would be that it is caused by the removal of piggieback middleware which does this https://github.com/nrepl/piggieback/blob/7bcda974b6df9aaae55d889c5f44507b47201cde/src/cider/piggieback.clj#L293-L310
Ok seems to be confirmed by the fact that I can run 2.8.52 with [cider/piggieback "0.4.1"] and option :nrepl {:middleware [cider.piggieback/wrap-cljs-repl]} in shadow-cljs.edn
shadow-cljs does not need or use piggieback at all. does this solve the CLJS REPL type detection issue?
Yes shadow doesn't need it but apparently cider does because it sets some vars that are needed to determine the right repl type
So now I am back at my clj-refactor not working, with this warning in the repl:
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
and if I call clr-refactor-ns
for instance I get Wrong type argument: stringp, nil
also in the build:
shadow-cljs - config: /home/yenda/clash/shadow-cljs.edn cli version: 2.8.52 node: v11.15.0
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by refactor_nrepl.inlined_deps.dynapath.v0v2v5.dynapath.defaults$eval8419$fn__8420 to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of refactor_nrepl.inlined_deps.dynapath.v0v2v5.dynapath.defaults$eval8419$fn__8420
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release