Fork me on GitHub
#cider
<
2019-02-15
>
yuhan06:02:27

I'm getting a strange error when trying to run cljr-add-project-dependency:

Retrieving list of available libraries...
cljr--get-error-value: Error in nrepl-refactor: clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(mranderson048/http_kit/v2v2v0/org/httpkit/client.clj:1:1)
 at clojure.lang.Compiler.load (Compiler.java:7391)
...

yuhan06:02:22

followed by a hundred lines of stacktraces involving refactor_nrepl, cider.nrepl, and nrepl.middleware

yuhan06:02:13

I'm running the latest versions of cider 0.21.0 and lein 2.90, the same error also happens in projects using deps.edn

benedek11:02:42

this is a java9+ related bug as far as i remember

benedek11:02:37

you are better off adding deps to your repl the way it is recommended in the cider docs

benedek11:02:04

there is a pr in clj-refactor to make this work again but afaik stalled atm

erwinrooijakkers16:02:37

Is it possible to use Cider for ClojureCLR?

Chase20:02:03

this might be a total shot in the dark but you might want to see what the Arcadia folks are doing. I think it's clojure on the unity game engine which is C#, right? I think they forked clojure clr. And they seem to have some kind of emacs repl goodness going on. https://github.com/arcadia-unity/Arcadia/wiki/REPL

dpsutton16:02:30

how do you run ClojureCLR? I'm not sure CIDER speaks any of the build tools for it?

erwinrooijakkers17:02:49

I don’t know how you run it

erwinrooijakkers17:02:35

I was wondering what editor I should use for it

erwinrooijakkers17:02:47

I hoped to be able to use Spacemacs

erwinrooijakkers17:02:55

But if Cider doesn’t work I don’t know what to use

erwinrooijakkers17:02:33

>>>CIDER currently doesn’t support ClojureCLR. The reasons for this are the following: nREPL itself runs only on the JVM (because it leverages Java APIs internally). There’s an nREPL port for ClojureCLR, but it’s not actively maintained and it doesn’t behave like the Clojure nREPL. cider-nrepl uses a lot of Java code internally itself. Those issues are not insurmountable, but are beyond the scope of our current roadmap. If someone would like to tackle them, we’d be happy to provide assistance.

erwinrooijakkers17:02:51

Hmm that’s a bummer

dpsutton17:02:53

ah, well there we go

dpsutton17:02:08

no problem. perhaps inf-clojure mode can work?

dpsutton17:02:45

it basically just forms commands that you could write yourself so in theory it doesn't care about which Clojure you talk to. (i think?)

dpsutton17:02:53

but that would keep you in spacemacs

erwinrooijakkers17:02:33

clj-refactor does work I guess

erwinrooijakkers17:02:37

Except for adding dependencies

richiardiandrea18:02:33

so I forgot how to add my custom aliases to a jack in command 😞

richiardiandrea18:02:07

oh right cider-clojure-cli-global-options

dpsutton18:02:32

and use prefix argument to edit the jack in command

dpsutton18:02:48

way easier. and way easier to randomly set it to whatever you want.

richiardiandrea18:02:22

I saw that, do I understand right that you basically need to modify the whole string?

dpsutton18:02:18

you don't have to. it plops the whole command in the minibuffer so you can see exactly where your modifications need to go

dpsutton18:02:35

so do that, go to beginning of line, and add -A:fig or whatever you need to do

dpsutton18:02:52

its so that every readme that shows which command line form to use is very easy to follow

dpsutton18:02:51

by the by, i'm running make autoloads and it doesn't seem to be working for me

richiardiandrea18:02:31

@dpsutton I think I do make and it does it all now

richiardiandrea18:02:38

what is the error?

dpsutton18:02:07

i've tried both. i get the classic command-execute: Wrong type argument: commandp, cider-find-var

richiardiandrea18:02:21

let me try here, I am on master

richiardiandrea18:02:47

uhm I do not see it either

richiardiandrea19:02:35

weird I see the section in cider-autoloads.el:

;;;### (autoloads nil "cider-find" "cider-find.el" (0 0 0 0))
;;; Generated autoloads from cider-find.el
(autoload 'cider-find-var "cider-find" "\
(autoload 'cider-find-dwim-at-mouse "cider-find" "\
(autoload 'cider-find-dwim "cider-find" "\
(autoload 'cider-find-resource "cider-find" "\
(autoload 'cider-find-ns "cider-find" "\
(autoload 'cider-find-keyword "cider-find" "\

dpsutton19:02:44

so its supposed to build up a file .depend and that never has any data written to it

richiardiandrea19:02:12

must be something else, the .depend are not used for autoloads

richiardiandrea19:02:53

also, in my case it is populated

dpsutton19:02:31

interesting. it is not in my case

richiardiandrea19:02:47

try make clean && make .depend what does it do?

dpsutton19:02:43

its populated on linux but not on mac

dpsutton19:02:51

i wonder if this is a bsd/gnu sed issue

dpsutton19:02:01

are you on mac or linux?

richiardiandrea19:02:52

could be, do you have the gnu package installed, I know you need it for grep for instance

richiardiandrea19:02:08

also, which command are you using for loading the autoloads?

dpsutton19:02:29

make autoloads

dpsutton19:02:39

but also make failed earlier for me (on mac). testing on linux

dpsutton19:02:48

waiting for project to crank up

dpsutton19:02:42

yes. the script calls sed -s which isn't supported in the BSD version

richiardiandrea19:02:36

no sorry I mean Elisp code you use for loading the autoloads..

richiardiandrea19:02:45

like use-package ...

dpsutton19:02:11

(add-to-list 'load-path "~/projects/dev/cider")
(require 'cider)

dpsutton19:02:51

oh i missed "9load "cider-autoloads" t t)

richiardiandrea19:02:00

yeah that is needed, I started to use use-package so maybe I am missing something here too 😉

dpsutton19:02:08

sorry to ask so many questions when i hadn't read the one line that would solve it for me

dpsutton19:02:21

autoloads are magical comments lol. who knows

richiardiandrea19:02:15

yes they are 😄

richiardiandrea19:02:37

question for you @dpsutton I still don't really understand if use-package is supposed to load cider-autoloads.el for me (kind a new to it)

dpsutton19:02:56

i've never used it either

richiardiandrea19:02:45

ok cool tnx 😉

dpsutton19:02:27

> If you're not using one of tho mechanisms that registers autoloads, such as :bind or :hook, and your package manager does not provide autoloads, it's possible that without adding :demand t to those declarations, your package will never be loaded.

dpsutton19:02:49

it looks like it gets a little manual. can you put that (load "cider-autoloads" t t) form right after use-package?

richiardiandrea19:02:17

I was going to try exactly that

richiardiandrea19:02:25

as I understand that you could just declare the function you are interested in and use-package created the autoloads basically

richiardiandrea19:02:02

this works for me:

(load "cider-autoloads" t t)

(use-package cider
  ;; This seems enough for cider, see also:
  ;; 
  :defer t

  :init
  (setq cider-popup-stacktraces t
        cider-popup-stacktraces-in-repl nil
        cider-repl-use-clojure-font-lock t
        cider-overlays-use-font-lock t
        cider-repl-wrap-history t
        cider-repl-history-size 1000
        cider-show-error-buffer t)

  :config
  (add-hook 'cider-mode-hook 'eldoc-mode)
  (add-hook 'cider-mode-hook 'paredit-mode)
  (add-hook 'cider-repl-mode-hook 'paredit-mode)
  (add-hook 'cider-repl-mode-hook 'eldoc-mode))

richiardiandrea19:02:42

only thing I am missing is how to bind cider-insert-last-sexp-in-repl to C-c C-c

richiardiandrea19:02:46

also to scroll the REPL when cider-insert-last-sexp-in-repl is doing its thing, @dpsutton do I have to set something for the scroll part?

dpsutton19:02:12

Not that I know of. Is it not scrolling with the input?

dpsutton19:02:37

Might just need to be fixed.

richiardiandrea20:02:23

Nope, I think that feature has been changed/tweaked - I will read more

richiardiandrea21:02:56

I put (setq scroll-conservatively 101) like I read somewhere but I don't see it scrolling unfortunately

richiardiandrea21:02:11

from the CHANGELOG: > * Option cider-repl-scroll-on-output is now obsolete, and the default REPL behaviour has changed to not recenter the window. The built-in variable scroll-conservatively can be set to 101 (either globally or locally in the REPL buffer) to restore the old behaviour. This change has a dramatic positive effect on REPL performance.

richiardiandrea21:02:29

with (setq scroll-conservatively 0) it does not do it either

Michael Griffiths23:02:51

Yeah, scroll-conservatively only has any affect if the point is moved – but it seems the insert-*-in-repl commands leave the point at the start of the input

richiardiandrea23:02:43

yes @cichli that's what happens, I see it as well now - maybe @dpsutton I can open an issue? no rush on this, just gathering some thoughts

Michael Griffiths23:02:18

I think the right thing to do is probably move the point to the input end… but I haven’t really used these commands so not sure if there’s a good reason they don’t do that 😄

👍 5
Michael Griffiths23:02:38

@richiardiandrea I’ve pushed another attempt at fixing https://github.com/clojure-emacs/cider/issues/2589 if you want to test again

richiardiandrea23:02:51

let me try live 😉

Michael Griffiths23:02:36

I’m curious as to why we end up calling buffer-substring-no-properties on the *cider-result* buffer rather than the source buffer… we explicitly don’t select it when we display it, but possibly something in your config is altering that

richiardiandrea23:02:04

it can be, I have a possible bloated Emacs Live custom branch

richiardiandrea23:02:13

I am trying to trim it down as much as possible

richiardiandrea23:02:54

@cichli it seems like it is working now

Michael Griffiths23:02:57

All the possible config around display-buffer is quite confusing so it’s possible we’re missing an edge case in the popup code

Michael Griffiths23:02:07

Great news! 🎉 Thanks for testing

richiardiandrea23:02:18

😄 no problem, thank you for debugging!

richiardiandrea23:02:52

this is the first time I am trying this feature actually, my workflow is quite different, usually I just send to the REPL buffer, having a dedicated result window has its advantages though

arohner23:02:00

In my cider repl buffer, *e used to print stacktraces, now it just prints

*e
#object[java.lang.AssertionError
        "0x5d79b28d"
        "java.lang.AssertionError: Assert failed:
. How do I get that behavior, printing the whole stacktrace, back? CIDER 0.20.0

Michael Griffiths23:02:08

(setq cider-print-fn 'pprint)?

Michael Griffiths23:02:00

Or do you mean printed like by clojure.repl/pst?

arohner23:02:03

I’m not entirely sure who is responsible for printing the exception, but at the moment, it’s behaving as if it’s doing the clojure.core/print-method default, rather than pst

arohner23:02:17

Is that a cider behavior, or my repl?

arohner23:02:55

hrm, appears to be cider-related, because the lein repl prints the whole stacktrace, as expected, when I *e