Fork me on GitHub
#cider
<
2018-02-09
>
denisgrebennicov19:02:39

Hey guys, I have a problem connecting to the repl using cider on spaceemacs. I've just started with emacs so I am kinda confused and didn't know where to write, so here I am. Any ideas why connection to the repl is not established?

emoarmy19:02:11

Have you used either the cider-jack-in or cider-jack-in-clojurescript commands?

denisgrebennicov19:02:46

the repl server is started but no connection has been made. When I close the spacemacs, he's asking me, whether or not I want to kill other processes too, showing me to the repl-server which I've created but didn't connect to

denisgrebennicov19:02:08

Sorry for bothering, wanting to tell that this was a code problem. I tried to start it in intellij and got the same problem, but a more descriptive error

denisgrebennicov19:02:49

This piece of code: (doseq [_ (range (Integer/parseInt (read-line)))] ... ) got me a

[{:type clojure.lang.Compiler$CompilerException
   :message java.lang.NumberFormatException: null, compiling:(test_project/core.clj:215:1)
   :at [clojure.lang.Compiler load Compiler.java 7526]}
Does anybody have a clue why this is happening?

gonewest81820:02:31

You’re feeding parseInt something that isn’t an integer.

denisgrebennicov20:02:55

@gonewest818 what do you mean by that? I didn't have a chance to give the input. I just wrote the code and wanted to start repl. I didn't provide any input, or did I get you wrong?

dpsutton20:02:50

what's at line 215 of test_project/core.clj?

denisgrebennicov21:02:09

Now I've already changed the code, being doing some stuff, now I have regex in my code, and I once again can not start the repl Error message:

[{:type clojure.lang.Compiler$CompilerException
   :message java.lang.NullPointerException, compiling:(test_project/core.clj:217:1)
   :at [clojure.lang.Compiler load Compiler.java 7526]}
  {:type java.lang.NullPointerException
   :message nil
   :at [java.util.regex.Matcher getTextLength Matcher.java 1283]}]
Code:
(let [[n k] (->> (clojure.string/split (read-line) #" ")
                 (map #(Integer/parseInt %)))
... )

tanzoniteblack21:02:12

@denisgrebennicov if you're having problems starting a repl, it generally means that you have code that's throwing errors at compile time rather than run time. Generally this means you have code as a def or just directly in the body that you'd be better off putting behind a defn

wiseman21:02:51

…it would be kind of awesome if cider handled this situation a little better.

denisgrebennicov21:02:03

hmmmm... I guess you are right 😅

wiseman21:02:25

i run into it frequently, and it seems a great opportunity to show a useful error message.

tanzoniteblack21:02:57

I believe that whenever I've run into this case, an error message has been printed in the *Messages* buffer

wiseman21:02:11

hm yeah maybe that’s enough--just tried it and i see a big stack trace in the minibuffer, and i can go to messages to see more. though it is very easy to accidentally clear the message from the minibuffer (any keypress), and be left with no indication that an error occurred unless you happen to have *Messages* open.

tanzoniteblack21:02:47

or...you just get so used to the cider eco system that you know where to go look when a repl fails to load. So yeah, some improvement in user friendliness in these situations could definitely be had

chris_johnson22:02:33

I’m a super newbie but I struggle to think what you could really do other than maybe have the error in the minibuffer just say “Your repl has had a bad problem and will not go to space today. See *Messages* for more information.”

chris_johnson22:02:49

there isn’t a good place to stick a “modal” (thank the maker) in an emacs session

tanzoniteblack22:02:32

maybe throwing it into a new attention grabbing buffer, like is what happens with the *cider-repl <project>* buffer?

wiseman23:02:44

i mean, cider pops open a nice buffer with an error message and stack trace when there’s a runtime error, right?

tanzoniteblack23:02:32

@wiseman you are indeed a wise man