This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-17
Channels
- # announcements (2)
- # aws (4)
- # babashka (20)
- # beginners (256)
- # calva (15)
- # chlorine-clover (1)
- # cider (12)
- # clj-kondo (25)
- # cljsrn (16)
- # clojure (115)
- # clojure-europe (7)
- # clojure-finland (5)
- # clojure-italy (10)
- # clojure-nl (35)
- # clojure-spec (13)
- # clojure-uk (83)
- # clojurescript (42)
- # code-reviews (81)
- # conjure (8)
- # cursive (6)
- # data-science (1)
- # datomic (3)
- # duct (18)
- # emacs (2)
- # figwheel-main (40)
- # fulcro (21)
- # helix (1)
- # jackdaw (7)
- # java (2)
- # lein-figwheel (5)
- # luminus (1)
- # observability (12)
- # off-topic (32)
- # parinfer (5)
- # pedestal (19)
- # re-frame (5)
- # reagent (8)
- # reitit (17)
- # rewrite-clj (47)
- # rum (19)
- # shadow-cljs (48)
- # spacemacs (4)
- # sql (40)
- # tools-deps (22)
- # vrac (1)
- # xtdb (25)
From the docs:
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
Is it possible for a macro to tell cider which string is a docstring? something like :style/indent
.
@doglooksgood Currently not. What’s your usecase?
I just curious, the docstring for user macros, can't get a correct highlight. anyway, this is not important.
Ah, I think I misunderstood you. clojure-mode
has some degree of configurability about this, but I guess it depends on the macro.
I want to remap M-e to eval last sexp. how to do it? please help.
I tried this `(define-key cider-repl-mode-map (kbd "M-e") #'cider-eval-last-sexp )` but it did not work (edited)
This is the error Symbol's value as variable is void: cider-repl-mode-map
thank you.
(require 'cider-eval)
(define-key clojure-mode-map (kbd "M-e") #'cider-eval-last-sexp )
this worked
If you’re working in some namespace
(ns some.namespace
(:require
[clojure.spec.alpha :as s]))
(s/fdef add-pos-ints
:args (s/cat :a pos? :b pos?))
(defn add-pos-ints [a b]
(+ a b))
and then enable spec instrumentation in the repl:
some.namespace> (require '[clojure.spec.test.alpha :as stest])
some.namespace> (stest/instrument)
then spec will give you the errors you’d expect:
some.namespace> (add-pos-ints 1 -1)
-- Spec failed --------------------
Function arguments
(... -1)
^^
should satisfy
pos?
-------------------------
Detected 1 error
but if you then reevaluate the buffer (say by calling cider-eval-buffer
), then instrumentation no longer gives you the errors you’d expect:
some.namespace> (add-pos-ints 1 -1)
=> 0
this makes sense with the way instrumentation works, but it’s a frustrating development experience to have to call (stest/instrument)
every time you reevaluate something.
is there any way to have spec instrumentation always be “on” in Cider?
for instance, is there some way to define a hook that would get called whenever you call cider-eval-buffer
, so you could automatically call (stest/instrument)
?