This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-03
Channels
- # aleph (1)
- # beginners (42)
- # boot (34)
- # cider (157)
- # cljs-dev (12)
- # cljsrn (3)
- # clojure (165)
- # clojure-conj (1)
- # clojure-india (1)
- # clojure-italy (6)
- # clojure-russia (20)
- # clojure-spec (27)
- # clojure-uk (173)
- # clojurescript (116)
- # cursive (30)
- # datomic (87)
- # devcards (1)
- # docs (9)
- # emacs (2)
- # ethereum (2)
- # events (2)
- # fulcro (60)
- # graphql (10)
- # hoplon (2)
- # jobs-rus (6)
- # keechma (1)
- # lein-figwheel (9)
- # leiningen (36)
- # luminus (2)
- # mount (3)
- # off-topic (16)
- # om (14)
- # onyx (12)
- # pedestal (19)
- # portkey (107)
- # re-frame (9)
- # reagent (5)
- # ring (26)
- # shadow-cljs (149)
- # spacemacs (3)
- # sql (6)
Ya know...just going back to a previous version sounds much simpler.
so @boogie666 we need to find cider.el
if i go to the .clj file and do same i did before i can find the cider--connected--handler function
are you sure you have that function selected? maybe just try to find-function
on cider-mode
or something similar
navigate as normal, hit enter to go to directory or file, and hit ^
to go up a directory
awesome! search for cider, should be a directory like cider-23423423423432
something like that
(defun cider--connected-handler ()
(let ((cider-enlighten-mode nil))
(cider-make-connection-default (current-buffer))
(cider-repl-init (current-buffer))
(cider--check-required-nrepl-version)
(cider--check-clojure-version-supported)
(cider--check-middleware-compatibility)
(cider--subscribe-repl-to-server-out)
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
(sleep-for 0.1) ;; <-- Increase timeout till it works
(cider--debug-init-connection)
(run-hooks 'cider-connected-hook)))
i've been using atom with proton-mode so far and thought i'd give spacemacs a try for a little bit 🙂 looks like i'm back in business 🙂
good. sorry for the hiccup. but emacs is super great and has really been nice. its so nice that its just an elisp ide that happens to edit text pretty well
for sure. and understandably people love vim interaction so spacemacs has got a lot going for it
anyone having this issue?
nREPL server started on port 56754 on host :: - nrepl://:::56754
[2017-10-03 14:27:43,717] ERROR Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session e25f7710-305d-4e6e-a3ca-176d8f861ea4, :id 6} (clojure.tools.nrepl.server)
java.lang.IllegalAccessError: with-safe-transport does not exist, compiling:(cider/nrepl/middleware/info.clj:1:1)
on 0.16.0snapshot?
ah I'm not the only one apparently https://github.com/clojure-emacs/cider/issues/2092
yes ok that makes it works, thanks @dpsutton
I'll keep that around until there is another fix of some sort
awesome. if you are feeling more investigative, there's a patch to nrepl you can try and report if that fixes
you need to clone a fork of cider-nrepl and lein install it. takes substantially more work so not necessary if you're trying to get other things done
ah yes ok I'll see it if fixes it, however it's not an OSS project what I'm working on now so would be maybe better to reproduce it on something I can show
it depends on the dependencies from my understanding
mm odd now I tried to debug a function and I get
1. Unhandled java.lang.Exception
Debugger not initialized!
don't think it's related but I've never seen that before, anyone knows what it could be the problem?
(defun cider--connected-handler ()
(let ((cider-enlighten-mode nil))
(cider-make-connection-default (current-buffer))
(cider-repl-init (current-buffer))
(cider--check-required-nrepl-version)
(cider--check-clojure-version-supported)
(cider--check-middleware-compatibility)
(cider--subscribe-repl-to-server-out)
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
(sleep-for 0.1) ;; <-- Increase timeout till it works
(cider--debug-init-connection)
(run-hooks 'cider-connected-hook)))
Fwiw installing a new version of cider-nrepl per the instructions in the issue I reported fixes things so I no longer have an issue
mm well I didn't edit anything I just redefined it @dpsutton
if you didn't edit it, then you changed nothing. i'm not sure i follow. did you just paste the above or did you add the one line that fixes the problem: (sleep-for 0.1)
?
@dpsutton I just copied that function in ielm
which evaluates it re-defining the original one
I prefer to do that than changing a file not under revision control
then i'm out of ideas. assuming the above is correct. maybe past that into the elisp repl or whatever you are using and make sure all of the names are spelled correctly?
there's a way to change the pretty printer. perhaps the one you have isn't good with your data. if its long strings or heavily nested maps perhaps?
I've been trying many "ways" for three years in cider, and still can't get a reliable formatting for edn files.
have you tried clj-format? https://github.com/weavejester/cljfmt
i'm trying to remember how to see the nrepl traffic. i think the toggle function has been renamed
M-x nrepl-toggle-message-logging
maybe see what the call to format the edn is returning
maybe there's some response coming back with more information than cider is displaying?
I get a response as "done"
(<--
id "95"
session "917da08e-ebb3-4e5e-8492-16bcaf6716e5"
time-stamp "2017-10-03 12:16:41.289718364"
formatted-code "({:uri "chef_module", :name "chefnode1", :kind :chef_node, :..."
status ("done")
)
you can try this in your own cider: Create a map with three keys, repeat 500, and spit it using pr-str. Now, try to format it.
and is this lacking newlines between the structures? my worry is that this is long lines and guessing new lines running up against 20,000 characters in a row
every single editor does that for json, I don't see a reason not to provide a default in cider.
that's what I'm trying to figure out, if it's an easy el script ... could copy that in my emacs ...
i think emacs might use pprint by brandon bloom by default. this is not simple code.
If your day job involves parsing large edn files (who doesn't do that :)) I'm positive that formatting and paredit navigation to edn structures is a massive help.
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/format.clj#L33
if this is your first time getting up and going, keep notes and would love tutorials, code walkthroughs, newbie instructions, overviews, whatever, you want to submit as a PR to hacking-cider. it's just a collection of markdown files to get people going
i think you choose your pretty printer in cider
(defun cider--pprint-fn ()
"Return the value to send in the pprint-fn slot of messages."
(pcase cider-pprint-fn
(`pprint "clojure.pprint/pprint")
(`fipp "cider.nrepl.middleware.pprint/fipp-pprint")
(`puget "cider.nrepl.middleware.pprint/puget-pprint")
(_ cider-pprint-fn)))
and you can see the middleware here reads the pprint-fn var set in the message:
defn pprint-reply
[{:keys [pprint-fn session transport] :as msg} response]
(with-open [writer (pprint-writer msg)]
;; Binding `*msg*` sets the `:id` slot when printing to an nREPL session
;; PrintWriter (as created by `pprint-writer`), which the client requires to
;; handle the response correctly.
(binding [*msg* msg
*out* writer]
(let [value (cljs/response-value msg response)
print-fn (if (string? value) println pprint-fn)]
(print-fn value))))
(transport/send transport (response-for msg :pprint-sentinel {})))
@pri did that answer your question? i didn't meant to spend a lot of time on irrelevant or things you already knew
to change the var used (and i'm not totally sure this is actually used in formatting end) set the var cider-pprint-fn
. in your init you can (setq cider-pprint-fn 'fipp)
or use the customize menu
The more important question--as I've run through this issue for three years, is: why is cider reluctant to provide a sensible default?
i think it has built in to format edn? and it defaults to the clojure pretty printer.
i'm pretty sure we're in a "default doesn't do anything in this situation" type of situation
yeah. i'll bet it will excel at it. lodge an issue? i may not know enough to help you out and someone else can get you closer to your goal?
Can CIDER be configured to warn in case of a lein error? With a certain bug in my source code, lein repl
tells me #error {:cause Unable to resolve symbol: Foo in this context
... }
, then starts a REPL anyway with my project's namespace prompt. cider-jack-in
just gives me the prompt, leaving it to me to discover that something is busted, then try to figure out what. Is there a better workflow than first running lein repl
to make sure your project is qualified for cider-jack-in
? Running Emacs 25.2.2, just installed CIDER today from Melpa-stable.