Fork me on GitHub
#cider
<
2019-08-22
>
dpsutton00:08:55

@m0smith what happens when running with just lein/boot/clj? Does it succeed?

m0smith00:08:35

Yes it works from clj

m0smith15:08:12

Turns out change :stdout to :stderr seems to fix the problem

m0smith15:08:23

(ns bug-demo (:require [datomic.ion.cast :as cast] [http://clojure.java.io :refer [output-stream]])) (cast/initialize-redirect :stderr) ; instead of :stdout (cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})

g00:08:27

has anyone developed any kind of fuzzy find for repl input history?

dpsutton00:08:23

I just hit ,history and then use whatever text search I want in the history buffer that pops up

arohner14:08:09

I’m trying to start an embedded nRepl in my app. I’m following the instructions at https://github.com/clojure-emacs/cider-nrepl#via-embedding-nrepl-in-your-app and I’m getting

ERROR: Unhandled REPL handler exception processing message {:ns user, :file *cider-repl griffin/banksy:localhost:4005#2(clj)*, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :op eval, :column 7, :line 45, :id 18, :code (System/getenv), :content-type true, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/options {:right-margin 70}, :session 2bd54e06-29e1-45c6-9569-a82e782ec11f}
java.lang.NullPointerException
	at clojure.core$deref_future.invokeStatic(core.clj:2300)
	at clojure.core$deref.invokeStatic(core.clj:2320)
	at clojure.core$deref.invoke(core.clj:2306)
	at cider.nrepl$wrap_tracker$fn__401.invoke(nrepl.clj:435)
	at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
	at nrepl.middleware.print$wrap_print$fn__1162.invoke(print.clj:234)
	at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
	at cider.nrepl$wrap_info$fn__327.invoke(nrepl.clj:180)
	at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
	at nrepl.middleware.session$session$fn__1355.invoke(session.clj:272)
	at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
	at clojure.lang.Var.invoke(Var.java:384)
	at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
	at nrepl.server$handle_STAR_.invoke(server.clj:15)
	at nrepl.server$handle$fn__1386.invoke(server.clj:27)
	at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:835)

arohner14:08:02

I’m running nrepl 0.6.0 and cider-nrepl 0.21.1

arohner14:08:55

(defn nrepl-handler []
  (require 'cider.nrepl)
  (ns-resolve 'cider.nrepl 'cider-nrepl-handler))

(nrepl/start-server :port port
                                 :bind host
                                 :handler (nrepl-handler))

Yehonathan Sharvit15:08:00

Hi there! Cider really rocks! Is there a way to search for a function definition without specifying its namespace or even better with specifying only part of its name?

dpsutton15:08:50

check out cider-apropos its awesome

arohner15:08:03

My bug appears to be AOT related. My nrepl code is in the main namespace, with a :gen-class. If I comment out the :gen-class, the nrepl starts fine

Yehonathan Sharvit15:08:16

@dpsutton Indeed cider-apropos looks awesome! I am in Spacemacs. When I hit enter on a symbol on the cider apropos buffer it displays the doc of the function. How do I get to the source code of the function?

pez15:08:37

@viebel, the same way as you do it in a code buffer? (I'm just guessing, but it would make sense to me 😄)

dpsutton15:08:12

looks like that needs some feature work

Yehonathan Sharvit15:08:10

@pez @dpsutton In order to get to the code of the function, I have to press TAB and then ENTER. Is there a quicker way to navigate quickly to the source code of a function without typing the fully qualified name of the function?

jumar07:08:53

@viebel this looks reasonably efficient to me. You don't need to type anything imho; it should jump straight into the source code. The other alternative (which I use) is to just press s (still assuming you're in the doc buffer where you got after pressing RET in the cider-apropos output buffer)

Yehonathan Sharvit09:08:54

Awesome. I didn’t know about pressing s in the cider-apropos output buffer. Where is it documented?

dpsutton12:08:49

Oh I didn’t know this either. Wonder if pressing ? Brings up a menu

dmaiocchi18:08:09

if cider-jack-in create a new session,, what is the clone function in cider?

dmaiocchi18:08:33

for cloning a session created by cider-jack-in

bozhidar19:08:15

@darioszr cider-jack-in creates a new CIDER (sesman) session, not a new nREPL session.

bozhidar19:08:49

A CIDER session is basically a group of connections (REPLs) attached to the same server.

bozhidar19:08:18

Generally end users never need to directly manipulate nREPL sessions.

dmaiocchi19:08:36

But cider jack in start a server right

bozhidar19:08:39

Yeah, it does.

dmaiocchi19:08:42

If not stated already. I think I confuse some terms in my question before.. I was duck programming myself

bozhidar19:08:14

And every CIDER connections opens up two nREPL sessions - one for user commands and one for internal commands.

bozhidar19:08:48

The second one is needed so the internal commands won’t clobber things like *1, *e, etc, which are session-bound in nREPL.

dmaiocchi19:08:24

A session sofar is a thread Damon on server with a state atom right?

bozhidar19:08:00

Yeah, I guess that’s a reasonable way of putting it.

bozhidar19:08:32

Sessions exist to allow us to multiplex a single connection and do different things over it.

dmaiocchi19:08:57

Yep. I saw the clone thing

bozhidar19:08:03

Each has its own evaluation thread and a bunch of dynamic bindings.

dmaiocchi19:08:26

OK thx clj 👍 cider

Yehonathan Sharvit19:08:36

What is the quickest way to navigate quickly to the source code of a function without typing the fully qualified name of the function?

pez20:08:18

I don't know the name of the command, but I press alt+.

Quest20:08:58

M-. -- executes cider-find-var FYI you can find command names via the input keystroke with C-h k (& yeah, I had to look that up to remember it. I usually try to find commands via regex via C-h a)

metal 1
Yehonathan Sharvit21:08:45

The problem with cider-find-var is that I have to type the whole name of the var and the var is not on the current ns it is very cumbersome

Quest21:08:03

Hmm, it should autofill to the symbol under the point if working correctly. M-. then hit enter, instantly goes to source

jumar07:08:43

Exactly, it should work that way. As long as cider recognizes the symbol under the point it shouldn't ask for anything. @viebel btw. I use g d (jump-to-definition) in spacemacs - this even works without connected REPL (but it's obviously quite limited in that case)

pez07:08:51

And M-, (that's a comma), for jumping back to where you were, @viebel

Yehonathan Sharvit09:08:44

Guys, this is not what I am asking. I am asking for a way to look for a var by typing its name partially. Let’s say I am in ns foo and I look for var bar/my-func. I would like to be able to type “my-func” or “my-f” and let CIDER take me to a list of symbol that matches “my-f”. Something like cider-apropos that takes me to the definition of the var instead of displaying the doc of the var.

jumar13:08:40

@viebel I'm saying that you can use cider-apropos - it's just one extra key press (`s`)