This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-23
Channels
- # announcements (1)
- # architecture (20)
- # babashka (30)
- # beginners (79)
- # calva (27)
- # cider (8)
- # clj-kondo (1)
- # clojure (125)
- # clojure-australia (1)
- # clojure-berlin (4)
- # clojure-europe (62)
- # clojure-france (1)
- # clojure-italy (6)
- # clojure-nl (4)
- # clojure-uk (12)
- # clojuredesign-podcast (5)
- # clojurescript (28)
- # core-async (31)
- # cursive (14)
- # datomic (47)
- # defnpodcast (1)
- # emacs (7)
- # figwheel-main (2)
- # fulcro (10)
- # graalvm (1)
- # graphql (11)
- # jobs-discuss (8)
- # leiningen (2)
- # off-topic (23)
- # rdf (9)
- # re-frame (3)
- # reagent (1)
- # reitit (5)
- # reveal (12)
- # shadow-cljs (12)
- # spacemacs (1)
- # tools-deps (87)
- # vim (22)
- # xtdb (21)
A new CLI: https://github.com/borkdude/puget-cli Can be used to colorize / pprint EDN.
I'm having issues showing the documentation of a variable using CIDER (with C-c C-d C-d
or cider-doc
). It doesn't use the symbol at point, and even if I type it, it returns an error. Example trace with map
:
Debugger entered--Lisp error: (wrong-type-argument stringp ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]))
string-match("\n" ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]) 0)
split-string(([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]) "\n")
cider-docview-render-info(#<buffer *cider-doc*> (dict "ns" "clojure.core" "name" "map" "built-in" t "arglists" "([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 &..." "doc" "Returns a lazy sequence consisting of the result o..." "file" "" "arglists-str" ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])))
cider-docview-render(#<buffer *cider-doc*> "map" (dict "ns" "clojure.core" "name" "map" "built-in" t "arglists" "([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 &..." "doc" "Returns a lazy sequence consisting of the result o..." "file" "" "arglists-str" ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])))
cider-create-doc-buffer("map")
cider-doc-lookup("map")
cider-try-symbol-at-point("Doc for" cider-doc-lookup)
cider-doc(nil)
funcall-interactively(cider-doc nil)
call-interactively(cider-doc nil nil)
command-execute(cider-doc)
No idea. I'm almost positive cider-doc
worked before. I'll check the result from the nrepl buffer
I'll try that, at the moment using:
`--> bb --version
babashka v0.2.3
CIDER 1.0.0snapshot (package: 20201020.1058)
(I just updated CIDER to see if it fixed the error, don't remember how old was my previous version)
I haven't checked older versions on the nrepl buffer yet, but looking at the error stacktrace I can see that the result from nrepl contains both an arglists
and an arglists-str
instead eval
is used:
(-->
id "22"
op "eval"
session "31de0313-76e6-4bf8-89bf-22e284741af8"
time-stamp "2020-10-23 23:55:22.795699101"
code "
(do
(require ')
(require 'clojure.walk)
(if-let [var (resolve 'map)]
(let [info (meta var)]
(-> info
(update :ns str)
(update :name str)
(update :file (comp str ))
(cond-> (:macro info) (update :macro str))
(cond-> (:special-form info) (update :special-form str))
(cond-> (:protocol info) (update :protocol str))
(cond-> (:arglists info) (update :arglists str))
(assoc :arglists-str (:arglists info))
(clojure.walk/stringify-keys)))))
"
)
(<--
id "22"
session "31de0313-76e6-4bf8-89bf-22e284741af8"
time-stamp "2020-10-23 23:55:22.805649515"
ns "hello"
value "{\"ns\" \"clojure.core\", \"name\" \"map\", \"built-in\" true, \"arglists\" \"([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])\", \"doc\" \"Returns a lazy sequence consisting of the result of applying f to\\n the set of first items of each coll, followed by applying f to the\\n set of second items in each coll, until any one of the colls is\\n exhausted. Any remaining items in other colls are ignored. Function\\n f should accept number-of-colls arguments. Returns a transducer when\\n no collection is provided.\", \"file\" \"\", \"arglists-str\" ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])}"
)
I completely forgot, but I added support for cider-doc myself a few months ago, I guess the code is out of date now
Hey no, it doesn't! https://github.com/clojure-emacs/cider/blob/1be3b89c00d9fe6d2b69e5b719d168e22d333a25/cider-client.el#L422 This is late for me, so I'll continue to investigate this tomorrow and will create an issue in babashka/nrepl then
Nevermind, found it, and it's a bug in cider, I'll file a report there.
The eval code is a fallback when there's no nrepl support for the op info
, which is why it happens on babashka.
Commit in question: https://github.com/clojure-emacs/cider/commit/1be3b89c00d9fe6d2b69e5b719d168e22d333a25
E.g. for map
I get:
{"ns" "clojure.core", "name" "map", "built-in" true, "arglists" "([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])", "doc" "Returns a lazy sequence consisting of the result of applying f to\n the set of first items of each coll, followed by applying f to the\n set of second items in each coll, until any one of the colls is\n exhausted. Any remaining items in other colls are ignored. Function\n f should accept number-of-colls arguments. Returns a transducer when\n no collection is provided.", "file" "", "arglists-str" ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])}
`