This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-07
Channels
- # beginners (95)
- # cider (131)
- # cljdoc (12)
- # cljsjs (2)
- # clojure (209)
- # clojure-dev (1)
- # clojure-italy (3)
- # clojure-nl (10)
- # clojure-russia (37)
- # clojure-spec (19)
- # clojure-uk (182)
- # clojurescript (136)
- # cursive (28)
- # datomic (28)
- # editors (55)
- # figwheel-main (1)
- # fulcro (36)
- # hyperfiddle (12)
- # jobs (1)
- # jobs-discuss (55)
- # luminus (1)
- # mount (1)
- # off-topic (28)
- # onyx (18)
- # reagent (17)
- # ring-swagger (4)
- # rum (14)
- # shadow-cljs (22)
- # spacemacs (15)
- # tools-deps (16)
- # vim (26)
hey all I am seeing this error while starting up cider
Caused by: java.lang.RuntimeException: Unable to resolve var: cemerick.piggieback/wrap-cljs-repl in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
brand new lein new reagent
template appalso if you see something like :nrepl-middleware [cider.piggieback/wrap-cljs-repl]
make sure its using cider.piggieback not cemerick piggieback
@dominicm Youâve got it! đ Btw, I just removed 1.7 from the build matrix as the builds were taking forever. And it was actually piggieback which is really using something from 1.8, not Orchard (yet).
@benedek Thereâs no incompatibility - from what I see some piggieback tests are failing to pass as the middleware descriptor is not properly set. It might be possible that for some reason in the tests piggieback required the tools.nrepl namespaces instead of the nrepl ones. Nothing else can produce such a problem IMO.
Youâre welcome! Basically this is the key thingy in the log:
lein test refactor-nrepl.ns.resolve-missing-test
[WARNING] No nREPL middleware descriptor in metadata of #'cider.piggieback/wrap-cljs-repl, see nrepl.middleware/set-descriptor!
It must the dep on cider-nrepl 0.18 which pulls and loads the old nREPL. Iâve updated this, so now Iâm optimistic the tests will pass.
Lars already deleted everything about hot-loading deps, so I guess weâre back in business, right?
Iâve made it a habit to delete the last paren of whichever sexp Iâm working on, so that I can press RET
without actually executing it. Is this the ârightâ way to do it, or is there a smarter way? Itâs starting to feel a little repetitive with that ânavigate to last closing paren -> delete itâ manoeuvre all the time.
In the CIDER repl, that is.
Great, just what I was looking for! Is it called anything?
I think itâs called newline-and-indent
or something like this. In paredit itâs paredit-newline.
Cheers @bozhidar
@reefersleep although some would argue that the "right" way to do it is to edit expressions in a (non-REPL) buffer and evaluate them / send them to the REPL from there
@euccastro Iâve considered this approach as well, and I think Iâll give a it a go now, to see how it feels đ
Thanks!
@euccastro regarding that approach; once Iâm done editing a sexp, I usually end up just before the last paren, or somewhere deeper inside. IntelliJ has something like âsend top form to REPLâ, whereas in CIDER, I can only find âcider-send-last-sexp-to-replâ. Itâs a bit of a hassle that I have to navigate to a specific point in my text before sending to the repl. Is there some better functionality that I canât see?
@reefersleep Weâve got a bit of weird terminology - `top-level formâ is âdefunâ in CIDER (legacy from Elisp). Almost every command has a version that operates on the current form and the current top-level form.
Brilliant!
cider-eval-defun-at-point
does what I want, then
Iâm experiencing leaps forward in my REPL efficiency and joy today đ
Cheers again!
if only you could compose actions and targets somehow? You could call them operators and text objects...
Right? I use spacemacs in hope of getting the best of both world, but sometimes that means Iâm fumbling around in a mishmash of two separate and, by themselves, streamlined paradigms. Pretty happy, though đ
I use vim for reals, I couldn't handle the two worlds colliding in spacemacs. I was searching for text objects & operators, and they didn't exist.
I may try to go back at some point. Iâm just getting more and more config fatigue every day in my developer carreer, and spacemacs has been pretty good in that regard⌠Though, of course, not perfect. đ
spacemacs out of box is amongst the best, that's correct. I don't have that fatigue, quite happy tweaking things đ
Not sure what those abstractions are, but I guess vim must have gotten something right. đ
@bozhidar I canât believe you havenât had someone try to mansplain the brilliance of vim to you yet⌠? đ
This, however, was 15 years ago and I was a pretty basic vimmer at the time. I loved the navigation/editing experience, but I hated VimScript with a vengeance.
Ah, alright đ I switched to Emacs hoping to be boosted tool-wise by everyone elseâs love of Elisp and hate of VimScript. But only because evil-mode is the best vim emulation that I know, otherwise I would still be fighting with installing Vim plugins đ The text navigation and editing of Vim is superb, imo. Do you use evil-mode or something similar, then?
in spacemacs "evaluate expression before point" is , e e
and "evaluate top-level form at point" is , e f
, so while this is not really implemented in terms of operators and text objects, it kind of feels like that. in cleverparens there is actually a "form" text object bound to f
, further reinforcing the illusion (I can see how this could be dangerous). but I'll take spacemacs over vim for the same reasons I'll take Clojure over Scheme
even if I have to deal with emacs <-> vim impedance mismatches just like I have to deal with Java and JS ecosystems more than I'd like
as soon as someone comes with the perfect editor and language I'll be happy to switch, but I'm not holding my breath
because both the perfect (kernel for a) language and the perfect (kernel for an) editor will have to catch up with decades worth of work poured into emacs and Java/JS
@reefersleep I do the same thing with this:
;; make cider repl indent and newline on enter and eval on
;; control-enter
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
this makes enter do a newline and control enter send the form. I cannot imagine using the repl without this change any longeralso @reefersleep check out the "insert" commands map at C-c C-j
. has commands to insert defun, expression, and region
these are useful for that as well
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-after-insert-p nil)
(setq cider-eval-toplevel-inside-comment-form t)
@dpsutton the enter->newline, control+enter->send form is what Iâm used to from my IntelliJ-using colleagues, as well đ Itâd probably make sense for me to remap this as well, so cheers! Iâll have a look at the other things!
@dpsutton Iâm trying to find the SPC foo bar
entry into the C-c C-j
menu, but I donât know how to look for it, exactly
(I use Spacemacs)
Yeah, I can enter the menu with C-c C-j
and see the function names in helm. Normally I use SPC foo bar
, though, and Iâd like to reuse that pattern, also because it is (re-)discoverable, as helm shows all of the foos
and bars
for each keypress.
I can search shortcuts with SPC ?
, I found out đ And it turns out that cider-insert-commands-map
is not mapped to a SPC foo bar
ish sequence, only C-c C-j
, which explains why I couldnât discover it through normal means. However, now that I give the functions a thorough look, I see that they are the ones that Iâve been learning today đ and which are available through other sequences, such as SPC m s
. Thanks a lot, itâs been great getting more intimate with CIDER today!
next step is you customize CIDER to your needs. Then the next step is you identify a missing feature and submit a PR adding it for yourself and your fellow developers đ
I can connect a cljs buffer to cider and evaluate from there. But if the namespace has a huge list of other namespaces it depends on (those in :require
), evaluating doesn't work and a temp buffer shows up with a list of namespaces
I guess it's something to do with js stack limit
can we do anything about it?
what is huge in this case? I can't imagine stack limits and dep count being anywhere near each other
no, just ~15
can you explain more clearly how you are triggering this error and what you are evaluating?
I just eval simple things to test cider connection
like (+ 1 2) đ
it works in a cljs file that is small
but in another file, it has the said behavior
I eval with cider-eval-last-sexp, cider-eval-print-last-sexp etc
And you said it pops up a new buffer? Is it just a list of name spaces or is there other text in it? Do you know the name of the buffer
the buffer (or is it a buffer?) disappers whenever I press any key
I don't see it's buffer name or status bar
maybe it's a special kind of popup? I don't know Emacs well
I use emacs prelude btw
just (+ 1 2) really
@myguidingstar Maybe you can show us some screenshot or a gif?
ok, wait a minute
actually it's a long buffer and I can't scroll up to see what's in the beginning
i'm not confident in what you are seeing to be able to answer what might be the cause
here the screenshots https://i.imgur.com/QCGqJRr.png
I have two cljs buffers as seen on the screenshot
I used cider-eval-print-last-sexp at the end of the expression (+ [] {}) in both these buffers
the buffer on the left succeded with the output string
the buffer on the right didn't and the popup is in the bottom of emacs
can you try m-x nrepl-toggle-message-logging
and try again? we can see what's going across the wire
this will create a buffer called *nrepl-messages*
or something similar so we can look at the traffic
wait a minute
it looks like it is evaling the ns form and correctly returning nil. Did this evaluation pop up the results in the minibuffer as in your screenshot?
there was no result. When I tried (js/alert "abc")
there wasn't such side effect in the browser, either
with a custom code: (require '[figwheel-sidecar.repl-api :as ra])(ra/cljs-repl)
I have a .dir-locals.el
with this content
((nil
(cider-default-cljs-repl . super-cljs)
(cider-cljs-repl-types . ((super-cljs "(require '[figwheel-sidecar.repl-api :as ra])(ra/cljs-repl)")))))
(as in cider doc cljs guide)
then I just use cider-connect-cljs
here's the whole nrepl log buffer https://gist.github.com/myguidingstar/91866e7681942f6af0cf015fc3ecba7c
(I killed the buffer before eval so I guess it's clean)
when I focus to other windows, Emacs automatically saves the file and the said popup "buffer" show the message "Wrote ..." https://i.imgur.com/XND8Kby.png
Trying make build
in the cider folder but it fails that cannot find sesman-browser
uhm does not seem to work weird
oh I need to update cask deps
no đ
uhm it tells me:
For more information about these matters, see the file named COPYING.
cask install
Some dependencies were not available: sesman, spinner, queue, pkg-info, clojure-mode, markdown-mode, buttercup, elisp-lint
Makefile:23: recipe for target 'elpa-emacs' failed
make: *** [elpa-emacs] Error 255
which is weird
solved, I had compiled with no gnutls
also I had just moved to 18.04 and needed to blow ~/.emacs.d/.cask
and all the other ones