cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
MatD 2020-08-12T01:04:24.001400Z

Nevermind, I figured it out

jumar 2020-08-12T03:53:37.001600Z

This depends on your setup, java version, etc. I haven't been able to do that either, at least since I'm using JDK version > 8. Advice usually goes like adding java sources to your project explicitly. Here's one issue mentioning this problem: https://github.com/clojure-emacs/cider/issues/2269

Ben Sless 2020-08-12T08:44:15.003400Z

What's the best way of configuring the java version per project? I have not found a way of setting environment variables with dir-locals and cider has no variable which would translate to LEIN_JAVA_CMD This was probably asked in the past but I was unable to find an answer online

bozhidar 2020-08-12T09:41:39.006200Z

@ben.sless I never thought of this actually, as I typically work on projects that target the same JDKs. Probably it'd be easiest to change the Emacs exec-path in dir-locals.

bozhidar 2020-08-16T17:36:08.035300Z

You need eval if you want to invoke some function in dir-locals - https://emacs.stackexchange.com/questions/21955/calling-functions-in-dir-locals-in-emacs

Ben Sless 2020-08-12T10:01:36.006300Z

huh, didn't occur to me to manipulate exec-path. I'll try and report results. Thanks 🙂

Ben Sless 2020-08-12T10:09:43.008200Z

Do dir-locals support something like

(cons "/usr/lib/jvm/java-14-openjdk-amd64/bin/" exec-path)
Its read literally 😞

jumar 2020-08-12T10:09:47.008500Z

I fought with various different setups using jenv on Mac OS in the past but eventually gave up - now I'm using the most recent version (14) for all the projects

Ben Sless 2020-08-12T10:16:00.009200Z

Well, I can just put this in a script and set it as a dir-local ((nil . ((cider-lein-command . "lein14"))))

cat lein14
#!/usr/bin/env sh
LEIN_JAVA_CMD=/usr/lib/jvm/java-14-openjdk-amd64/bin/java lein "$@"

bozhidar 2020-08-12T10:16:24.009700Z

Yeah, that would work.

plexus 2020-08-12T10:52:09.011600Z

Would someone with commit bit on piggieback have time to review this PR? https://github.com/nrepl/piggieback/pull/117 🙏

plexus 2020-08-12T10:53:16.012700Z

Currently when using a browser repl-env the logic to pprint evaluation results will error. This fixes that.

j0ni 2020-08-12T11:16:22.014900Z

hello cider people, I have a strange error which shows up when I try to cljr jump to references to a function at point - it gives me the “this will take a long time” warning, then computes for a bit, then fails with an exception complaining about a bad keyword in a dev namsepace. The “cause” exception has the following message and first few lines:

Caused by: clojure.lang.ExceptionInfo: [line 149, col 32] Invalid keyword: ::streams/topology. {:type :reader-exception, :ex-kind :reader-error, :file "/Users/joni/Scratch/xapix/clojud/dev/src/dev.clj", :line 149, :col 32}
	at refactor_nrepl.util$ex_info_assoc.invokeStatic(util.clj:27)
	at refactor_nrepl.util$ex_info_assoc.doInvoke(util.clj:24)
	at clojure.lang.RestFn.applyTo(RestFn.java:139)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:660)
	at refactor_nrepl.find.find_macros$find_macro_definitions_in_file.invokeStatic(find_macros.clj:51)

j0ni 2020-08-12T11:16:45.015400Z

I can make a bug later if that’s required, but I figured I’d ask around first

bozhidar 2020-08-12T12:15:39.015500Z

It's on my todo list.

plexus 2020-08-12T13:28:32.015700Z

thank you ❤️

practicalli-john 2020-08-12T14:29:27.015900Z

Sounds like you have a keyword in the dev.clj file that is invalid. Some clj-refactor commands require all the code to compile, so if there are bugs in the code they will fail.

j0ni 2020-08-12T15:37:49.016100Z

well sure, but the keyword is valid - streams is an alias for a required namespace. A few minutes later I was actually able to run the same command on a different symbol and it worked. That keyword is defined as an integrant key, if that’s relevant

j0ni 2020-08-12T15:38:30.016300Z

the fact that it worked after a while, suggests to me that some code was not loaded prior to the first invocation, but was loaded before I ran it again.

j0ni 2020-08-12T15:40:17.016500Z

hmm, I had some luck in the past disabling the pre-assembly of the AST, because of weird code loading issues and exceptions, as well as dynamic rebinds which caused errors - perhaps I’ll give that a shot next time I see this