cider

jmckitrick 2024-12-09T18:06:27.407559Z

How can I jump to a protocol implementation rather than definition?

Stig Brautaset 2024-12-09T18:11:30.604359Z

This was recently covered in this thread https://clojurians.slack.com/archives/C0617A8PQ/p1729784739018019 I believe the TL;DR is that Cider doesn't support it (yet)

oyakushev 2024-12-09T18:11:48.469849Z

Since extend-protocol/extend-type and the like don't store their location metadata into the protocol, it is not quite possible using runtime introspection. I think tools like LSP have such ability.

jmckitrick 2024-12-09T18:12:14.455169Z

Ah, ok. I'm trying to avoid LSP lol. Maybe I'm stuck

Stig Brautaset 2024-12-09T18:12:17.089969Z

Yes, I use clojure-lsp (via eglot) for this.

Stig Brautaset 2024-12-09T18:12:43.574409Z

I'm curious why you're trying to avoid LSP though 🙂

jmckitrick 2024-12-09T18:14:50.153279Z

I did try it for a bit. A colleague at work runs cider and lsp. I guess I just prefer the lightest setup that does the job, and I've seen lsp sometimes make a nuisance of pop-up annotations. I'm sure they could be disabled, but either way it seems a lot of work and overhead to run cider alongside lsp. That's my 'strong opinion, lightly held' and I'm always willing to learn a new or improved better way.

2024-12-09T18:20:00.347569Z

I was of the same impression as you, @jmckitrick , but ended up doing the job last year. I ended up turning off most lsp UI elements, but there are some real gems in there, like the "unused var" linter. My cider+lsp setup is here: https://github.com/magnars/emacsd-reboot

👍 1
jmckitrick 2024-12-09T18:20:37.802689Z

I will most certainly give it a second look now

Macroz 2024-12-09T18:22:39.435909Z

I tend to use grep for these things, works well enough for some variation of well and enough.

jmckitrick 2024-12-09T18:22:54.433449Z

That's my current/fallback plan

jmckitrick 2024-12-09T18:23:35.181809Z

It just gives me an inferiority complex around my colleagues running Cursive et al lol

Macroz 2024-12-09T18:23:40.758939Z

If you follow some specific conventions in your code, maybe you can do more accurate jumping. I tend to favour greppability in code, so a lot of my code is meant to work with primitive tools.

jmckitrick 2024-12-09T18:24:28.566969Z

I totally agree with you, and I used to be the guy that always put C/C++ function names at the beginning of their own line so I could grep for '^foo'

oyakushev 2024-12-09T18:25:39.328809Z

Glad we have ^(defn name for that.

jmckitrick 2024-12-09T18:25:57.145339Z

I switched to common lisp and clojure just for that 😜

Stig Brautaset 2024-12-09T18:29:53.322529Z

@jmckitrick you may want to try LSP via Eglot. The experience is more "bare" than lsp-mode. Here's how I set it up: https://github.com/stig/dotfiles/blob/trunk/emacs/init.el#L444-L470

jmckitrick 2024-12-09T21:48:36.154949Z

@stig328 I'll check that out