cider

oyakushev 2025-03-21T10:32:09.854449Z

Hello, friends! The latest rolling version of CIDER brings two workflow improvements: cider You can now jump (`M-.`) to functions and methods by their munged or Java-style name. Here are examples of printed names that are now navigable:

java.lang.String.substring
clojure.lang.AFn.applyToHelper
clojure.lang.Compiler$InvokeExpr.eval
nrepl.middleware.interruptible-eval/evaluator/fn/fn
clojure.main/repl/read-eval-print/fn
clojure.core$eval.invokeStatic
clojure.core$with_bindings_STAR_.doInvoke
clojure.main$repl$read_eval_print__9110$fn__9113.invoke
This should be useful when you encounter such names in printed stacktraces, for example. cider If you have ever been mildly annoyed by a delay between an exception happening and the appearance of *cider-error* buffer (especially, in big projects), this problem is now fixed. Enjoy those NullPointerExceptions at the speed of light!

6
5
🥳 6
yuhan 2025-03-21T10:49:09.576419Z

Does the excessive amount of backslashes in cider's jack-in command bother anyone else? It seems to have been unintentionally caused by changes made some time ago for Windows Powershell compatibility that ended up affecting Mac / Linux users, I think it hurts readability: Unnecessary escapes produced by shell-quote-argument

;;  Startup: /opt/homebrew/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.3.1\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.53.0\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.10.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:cider/nrepl 
Adequate level of escaping for POSIX shells:
;;  Startup: /opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.3.1"} cider/cider-nrepl {:mvn/version "0.53.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.10.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl

oyakushev 2025-03-21T11:09:38.352449Z

Speaking personally, this bothers me less that the chance of breaking something if we were to touch this:sweat_smile:

oyakushev 2025-03-21T11:11:43.267759Z

It is true that it is probably like that because of some Windows compatibility. We could have separate handling for different systems, but I don't know if it's worth it. I'll defer to @bozhidar

yuhan 2025-03-21T11:18:41.140299Z

Here's the change I tracked down: https://github.com/clojure-emacs/cider/pull/3342/files#diff-c53d920d1936b521743bbcd39f4f3c479f2122d4d051c30501310f6d6afc01bfL774 Note the addition of the call to shell-quote-argument on the non-powershell branch after the refactoring, I can't tell if that was intended as part of the fix https://github.com/clojure-emacs/cider/pull/3342/files#diff-c53d920d1936b521743bbcd39f4f3c479f2122d4d051c30501310f6d6afc01bfR761 But you're right, it's a minor annoyance

dpsutton 2025-03-21T12:20:04.238419Z

I think it’s worth fixing. It’s really nice if this can be copied and pasted to start the process. Makes using cider-connect trivial

oyakushev 2025-03-21T12:21:08.136339Z

But you can still copypaste it and start the process, right? It still works. It's just not very pleasant to look at.

👍 1
yuhan 2025-03-21T12:42:14.190229Z

Maybe it's a matter of sending the quoted mess off to start-process but displaying something friendlier in the REPL header.. I do think being pleasant to look at should count for something

yuhan 2025-03-21T12:44:24.932999Z

was curious about how Calva does it - here's the result of "Copy Jack-in Command Line to Clipboard"

(cd /Users/yuhan/scratch/repro; clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"1.3.1"},cider/cider-nrepl {:mvn/version,"0.52.1"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]")

bozhidar 2025-03-21T13:14:25.286909Z

I think it’s more or less how CIDER’s boot commands used to work early on before accounting for various edge cases. 😄 This particular issue doesn’t bother me much, as I’m still mostly using Lein, but I’m well aware I’m in the minority here. So, I’m open to improving this - if most of the escaping is done for the sake of Windows at the very least we can make this conditional.

bozhidar 2025-03-21T13:15:39.402649Z

> Note the addition of the call to shell-quote-argument on the non-powershell branch after the refactoring, I can’t tell if that was intended as part of the fix Yeah, looking at the diff I’m wondering the same myself - I’m guessing the escaping makes sense in some situations on Unix systems as well, but we can probably live without it.

bozhidar 2025-03-21T13:15:57.839239Z

PR welcome!

👌 1