This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-07
Channels
- # announcements (3)
- # beginners (124)
- # calva (60)
- # cider (81)
- # cljs-dev (65)
- # cljsrn (1)
- # clojure (268)
- # clojure-dusseldorf (2)
- # clojure-europe (3)
- # clojure-italy (9)
- # clojure-losangeles (1)
- # clojure-nl (22)
- # clojure-russia (3)
- # clojure-spec (24)
- # clojure-uk (34)
- # clojurescript (72)
- # code-reviews (8)
- # cursive (20)
- # datomic (32)
- # fulcro (49)
- # jobs (1)
- # jobs-discuss (15)
- # juxt (10)
- # lein-figwheel (10)
- # nrepl (4)
- # off-topic (37)
- # overtone (1)
- # portkey (2)
- # protorepl (8)
- # random (1)
- # re-frame (1)
- # reagent (43)
- # reitit (8)
- # ring (16)
- # ring-swagger (2)
- # rum (6)
- # shadow-cljs (63)
- # specter (2)
- # testing (32)
- # tools-deps (32)
- # unrepl (1)
- # vim (3)
hi everybody. With latest CIDER from MELPA, I am getting this:
ERROR: Unhandled REPL handler exception processing message {:op stacktrace, :pprint-fn cider.nrepl.pprint/pprint, :print-length 50, :print-level 50, :session f6e79029-f84e-4318-b301-f9273a1ba72e, :id 33}
clojure.lang.ArityException: Wrong number of args (1) passed to: cider.nrepl.pprint/pprint
CIDER seems to be injecting the latest snapshot on jack-in:
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.5.3"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'...
This from the REPL upon jack-in:
;; Connected to nREPL server -
;; CIDER 0.20.0snapshot (package: 20190105.1840), nREPL 0.5.3
;; Clojure 1.10.0, Java 1.8.0_191
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/pprint.clj#L13
That’s a multi-arity function so if you’re on the current build it should work. You can maybe delete whatever build you have locally in .m2/...
to force for it to be fetched again.
That’s one of the problems of making changes in snapshots - they are not refetched on each update. Don’t recall what exactly their update mechanism was.
Maven instructions: https://stackoverflow.com/a/7714058
Deleted the cider
directory from .m2
. Now I get this:
Caused by: java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/cljs__init.class, cider/nrepl/middleware/util/cljs.clj or cider/nrepl/middleware/util/cljs.cljc on classpath.
And I have:
~/.m2/repository/cider/cider-nrepl/0.19.0
❯ l
.rw------- 197 manuel manuel 7 gen 9:09 _remote.repositories
.rw------- 454k manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.jar
.rw------- 40 manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.jar.sha1
.rw------- 6,6k manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.pom
.rw------- 40 manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.pom.sha1
I have a CLJ/CLJS project, with shadow-cljs set up as I wrote at the end of this post: https://manuel-uberti.github.io/programming/2018/11/14/deps-shadow-cljs/
Every time I switch from a CLJ buffer to a CLJS buffer (within the same project), I end up with a buffer without its REPL "attached". If I switch to the relevant REPL and then back to the buffer, I get the REPL "attached" and I can C-c C-z
to it as usual.
And it does not happen if I switch from a CLJ buffer to a CLJ one, or from a CLJS buffer to another CLJS buffer.
What's the enviroment varibale for repl output to have line breaks?
on cider?
i'm not sure i'm following what you mean. can you tell me what behavior you are looking to have? output having linebreaks isn't really matching up with anything for me
when I get a map return and it's having a reaally long output
I want to have line breaks, like:
{:a "12071906913863921875721521"
:c "idhgsaukgfuksagfsajfgksajfkasjfgaskjfgaskjfgsakjfgsaj"}
cider-repl is giving me
{:a "12071906913863921875721521" :c "idhgsaukgfuksagfsajfgksajfkasjfgaskjfgaskjfgsakjfgsaj"}
on emacs?
(use-package clojure-mode
:ensure t
:config (add-hook 'clojure-mode-hook #'aggressive-indent-mode)
(add-hook 'clojure-mode-hook #'paredit-mode)
(add-hook 'clojure-mode-hook (lambda () (parinfer-mode t)))
(add-hook 'clojurescript-mode-hook #'paredit-mode)
(add-hook 'clojure-mode-hook (lambda () (rainbow-delimiters t)))
(add-hook 'cider-repl-mode-hook (lambda () (parinfer-mode t)))
(add-hook 'cider-repl-mode-hook (lambda () (rainbow-delimiters t))
(setq cider-repl-pop-to-buffer-on-connect 'display-only)
(setq cider-repl-use-clojure-font-lock nil)
(setq cider-repl-use-pretty-printing t)
(setq cider-repl-wrap-history t)
(setq cider-repl-result-prefix ";; => "))
it's on cider, not in clojure mode?
You also need to adjust *print-right-margin*
if you want it to break small data structures. I think by default it’s 70 or something like this.
if you have a repl open right now, hit ,
(comma) in it and select toggle-pretty
option in that menu
I'm starting a repl here, I'll test this
I don't use spacemacs
It’s also the configuration - the right margin forces when something has to be printed on multiple lines.
how can I activate the margin on repl?
I'm starting a repl here, I'll test this
how can I activate the margin on repl?
Just keep in mind that if you have some print options set in CIDER’s own config they’ll override the REPL dynamic vars.
Just an heads up, it seems like the signature of the pprint function has changed and fipp does not comply to it, causing a 💥 - haven't investigated more deeply atm
@richiardiandrea sprint function?
Lol no, pprint
function
I’m puzzled. fipp and pprint always had different signatures, at least if called with more than one params.
Uhm, so then my diagnosis is wrong, getting to the office then I will be able to check. I had to disable fipp yesterday
Currently we’re not using any pprint function directly anymore - all of them have wrappers with the same API in cider-nrepl.
Oh ok maybe that is why
I had cider-pprint-fn
set to 'fipp
KK will dig
Now a pprint function has to take an object and an optional list of config options to control the pprint.
Also - for something to be a meaningful pprint function it should return a string, not write to stdout.
hey @bozhidar is this worthy of a but report:
Debugger entered--Lisp error: (void-variable cider-stacktrace-print-length)
cider-default-err-op-handler()
cider-default-err-handler()
#f(compiled-function () #<bytecode 0x1e87921>)()
#f(compiled-function (response) #<bytecode 0xf03f55>)((dict "ex" "class clojure.lang.Compiler$CompilerException" "id" "233" "root-ex" "class clojure.lang.Compiler$CompilerException" "session" "a06ca30f-047f-4d0f-8999-e8b8e74e641a" "status" ("eval-error")))
nrepl--dispatch-response((dict "ex" "class clojure.lang.Compiler$CompilerException" "id" "233" "root-ex" "class clojure.lang.Compiler$CompilerException" "session" "a06ca30f-047f-4d0f-8999-e8b8e74e641a" "status" ("eval-error")))
nrepl-client-filter(#<process nrepl-connection> "d2:ex45:class clojure.lang.Compiler$CompilerException2:id3:2337:root-ex45:class clojure.lang.Compiler$CompilerException7:session36:a06ca30f-047f-4d0f-8999-e8b8e74e641a6:statusl10:eval-erroree")
or am I missing some config or something?i'll try fipp another day