Fork me on GitHub
#cider
<
2020-04-08
>
bozhidar06:04:45

I haven’t seen one so far.

aisamu13:04:58

Ugh, I'm positive there is a simple one (I've used it last year), but I really can't recall the name 😞

bozhidar06:04:00

CIDER borrowed the inspector idea from SLIME.

Hachmaninow11:04:08

G'day 🙂! I'm using Cider with Spacemacs and I'm loving it more and more. Though, I have two questions around running tests with cider-test-run-focused-test. 1. Is there a way to automatically save the current buffer in this situation? 2. Is there a way to prevent jumping to the cider-test-report window automatically in case of test failures?

Viktor11:04:26

Hi there, I have a test:

(deftest test-1
  (is (= 1 (inc 1))))
When I run lein test, then I get the output:
FAIL in (test-1) (test_lab.clj:19)
expected: (= 1 (inc 1))
  actual: (not (= 1 2))
but inside Cider I get:
Fail in test-1

expected: 1

  actual: 2          
	    diff: - 1          
	          + 2            
So it evaluates forms. Can I change this behavior?

aisamu13:04:58
replied to a thread:I haven’t seen one so far.

Ugh, I'm positive there is a simple one (I've used it last year), but I really can't recall the name 😞

aisamu13:04:47

(and comes with emacs 23+)

eval-on-point22:04:12

is there a way to eval a sexp with any parenting let bindings? for example, I have

(let [x 1] (= 2 (+ x x)))
and I want to eval (+ x x) without having to eval the parent sexp

rymndhng22:04:58

@mitchell_clojure yes, move your cursor to the position after the closing ) and use cider-eval-last-sexp, which by default is bound to C-c C-e

eval-on-point22:04:04

I get an unable to resolve symbol error there, since it does not know what x is bound to

eval-on-point22:04:36

I'm looking for something more like cider-eval-last-sexp-in-context , but which can infer the context of the defun

rymndhng22:04:24

right, so when you want to test the inside scope, you need to bind x. What some folks recommend is to execute (def x ...) so that at he global scope you have a x defined. See this post which does a better job of explaining this process: https://blog.cognitect.com/blog/2017/6/5/repl-debugging-no-stacktrace-required

eval-on-point22:04:00

yeah, what I am saying is that our eval function could bind the vars if they are declared in parent lets just by walking up the defun

eval-on-point22:04:23

but maybe that is more difficult to do than it appears on my first glance