Fork me on GitHub
#cider
<
2023-10-18
>
danielneal11:10:19

I’ve just updated and are getting these new exciting looking overlays. But they are just saying “Error in Thread” rather than adding any specific information. What am I missing?

daveliepmann11:10:27

wait, no, I get a stacktrace and cider-error buffer on that

daveliepmann11:10:04

do you have any config related to showing the cider-error buffer?

danielneal11:10:08

I don’t have any

danielneal11:10:16

My config is very minimal, out of the box

danielneal11:10:30

Add a paredit mode

vemv11:10:21

Is that the entire overlay? Your screenshot seems trimmed

danielneal11:10:15

The rest is more about the thread than the error

vemv11:10:07

Most times they're useful

vemv11:10:16

If you use the absolute latest Git master / MELPA snapshot you'll have available the latest customization options for them as seen at the top of https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md These implement @U05092LD5’s feedback for this feature.

danielneal11:10:56

I get the error in thread for (let [1]) too

vemv11:10:49

I don't, never have, please create an issue

danielneal11:10:39

Cool, I’ll see if I can get a minimal reproduction

👍 1
vemv11:11:38

We got the same report when using Flowstorm's custom clojure version. Was it that? A fix should be on its way from their side

danielneal12:11:09

Ahhh yeah that was it good catch!!!!

lassemaatta11:10:31

what's the cider-error-hoover overlay and can I disable it? Our logging implementation prints stuff in the REPL and it looks like that particular overlay is applied to some parts of some lines (not all). Accidentally clicking on such a line segment will open dired in the project root, which is a bit confusing.

1
lassemaatta11:10:31

I have a feeling that sometimes clicking on such a link would also trigger this: https://clojurians.slack.com/archives/C099W16KZ/p1692351993871399

vemv11:10:39

Sounds dense enough to warrant an issue :) Please create it and I'll be happy to attend it right away

vemv11:10:04

> I have a feeling that sometimes clicking on such a link would also trigger this: https://clojurians.slack.com/archives/C099W16KZ/p1692351993871399 Unrelated, however you are in luck, because we're fixing that today

🎉 1
vemv12:10:14

...Done https://github.com/clojure-emacs/cider/pull/3538 . Expect a couple hours for a MELPA release, and make sure that clojure-mode gets updated as well.

nice 1
Pavel Filipenco13:10:22

What setup is required with deps.edn for cider to load the namespaces and switch to some default? Also, are there any global deps.edn setup files (like .lein/profiles.clj) to add some universal user deps/plugins?

mjhika13:10:36

I can't answer the first question, but for the second you can use ~/.clojure/deps.edn

vemv13:10:14

I believe that setting a initial ns is hard. Lein achieves so in a hacky way. I asked about it here https://clojurians.slack.com/archives/C17JYSA3H/p1693584814024819 Ultimately, we could just add that feature to https://github.com/nrepl/nrepl

vemv13:10:48

Loading the namespaces is a touch easier. What's your workflow - tools.namespace or repl-driven?

Pavel Filipenco13:10:24

@U45T93RA6, repl-driven, if that means what I think it means. I don't know about tools.namespace. @U01C9CMAPK4, thanks for the link, helped me find more information, and I'm reading the practicalli guide now.

vemv13:10:55

One way could be to add to user.clj (a ns named user is always required automatically by Clojure) sufficient requires. Another approach would be to add a cider-connected-hook such that it performs requires or other stuff. Note that this will make your repl start more slowly, and may fail on startup. I believe that a purist approach would be to require stuff by hand, but not close your REPL too often. For that I'd recommend cider-connect over cider-jack-in, so that you can restart Emacs without losing your repl stuff.

👌 1
practicalli-johnny13:10:48

When using Cider with Clojure CLI, then only the Clojure CLI install is needed. https://practical.li/clojure/clojure-cli/ provides examples of common tasks on top of the Clojure CLI Evaluating code in source code buffers automatically evaluates the code in the correct namespace. Using rich comment forms allow experimental code to be separate from more stable code. A https://practical.li/clojure/clojure-cli/repl-startup/, although not for setting the namespace (code can be added to switch the namespace, but it will likely be superceded by the repl startup process Using the -e flag to pass an expression to evaluate code such as switching to a namespace should work fairly consistently. This is usually done within an alias that used when starting the repl

oyakushev13:10:52

@U060FHA3K28 This is how I do it: 1. Have ~/.clojure/user.clj file with the things I want to be present in every project. 2. Have this alias in ~/.clojure/deps.edn:

:user {:main-opts ["-e" "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/user.clj\"))"]}
3. Ensure that :user alias is appended to every clj call. For CIDER, you can add it to cider-clojure-cli-aliases variable. In the terminal, I went with a shell alias, like alias clj="clj -A:user"

vemv14:10:09

Plenty of cool approaches being shared :) A last one I can think of is setq cider-repl-require-ns-on-set t . By requiring the ns'es you visit, you'd get a recursive requiring. Similarly, there's cider-repl-init-code , which is good to tweak on .dir-locals.el

Pavel Filipenco14:10:12

@U06PNK4HG, thanks. Isn't there a standard clojure way to find where the config is located? XDG_CONFIG_HOME is much nicer, for example.

oyakushev14:10:30

If it is set, yes. It is empty for me on MacOS.

👍 1
practicalli-johnny16:10:25

@U060FHA3K28 I use XDG standard for Clojure CLI and Emacs (and Neovim), although there are a fewconfigs that don't support it, so I use symbolic links Here is a guide with details https://practical.li/blog/posts/adopt-FreeDesktop.org-XDG-standard-for-configuration-files/

👍 1
vemv19:10:17

ℹ️ We've released https://github.com/clojure-emacs/cider/blob/v1.8.3/CHANGELOG.md#183-2023-10-18 with a tasty batch of bugfixes, improvements and customization options, all Elisp side. One particular area that has gotten attention lately is error overlays (as seen in the screenshot). You can learn more about them here: https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration https://docs.cider.mx/cider/usage/code_evaluation.html#overlays Thanks much to everyone involved in giving accurate feedback.

🎉 9
cider 2
1
aisamu19:10:19

Thank you, vemv!

vemv19:10:04

Thanks to you / all of the frequent #C0617A8PQ dwellers!

vemv19:10:03

Make sure to also bump clojure-mode (5.18.0) to completely obliterate the dreaded No comment syntax is defined prompt 💥

💯 4