cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
bozhidar 2021-04-06T07:17:00.157500Z

I've been wondering lately what to do with suitable (the cljs completion library), as it has been broken for shadow-cljs for ages and disable in cider-nrepl because of this. See https://github.com/rksm/clj-suitable/issues/15 Ideally familiar with shadow-cljs should fix this issue, but as one year has passed and no one has stepped forward I'm not holding my breath. I can also disable this conditionally for shadow-cljs only or I can potentially remove it completely from CIDER and go back to the way things were before suitable. (e.g. I can put the generic completion code in Orchard and drop the fancy suitable stuff). As I don't use ClojureScript at all, I don't want to invest a lot of time in this, but it definitely frustrates me that things are the way they are. If someone here wants to help out with the clj-suitable issue that'd be greatly appreciated! If not - I'm leaning towards removing it from CIDER completely to simplify my life. The first option looks like less work for someone familiar with shadow, the second is what I know how to do. ๐Ÿ˜„

thheller 2021-04-06T07:21:08.159200Z

@bozhidar would it not be possible to have to his a completely separate opt-in library? I mean have a default auto-complete middleware and if loaded the suitable lib could just place itself in front of that and intercept/handle the messages like piggieback does?

thheller 2021-04-06T07:23:24.160600Z

doesn't change the problem but might ease your maintenance burden by keeping it out of your way

bozhidar 2021-04-06T07:23:26.160700Z

It is possible but it seems like an overkill at this point, especially since we moved the basic completion code for ClojureScript there as well. It seems to me it'd be much better to just update suitable for the shadow changes.

thheller 2021-04-06T07:23:55.161300Z

ah ok, didn't know that. thought there was a fallback solution

bozhidar 2021-04-06T07:24:38.162400Z

It has two completion sources - one that uses the cljs compiler state and always works and another one that inspects the runtime state and got broken.

bozhidar 2021-04-06T07:27:15.162700Z

This is what was historically in cider-nrepl https://github.com/rksm/clj-suitable/blob/master/src/main/suitable/compliment/sources/cljs.cljc

bozhidar 2021-04-06T07:29:06.164Z

Now that nREPL has a completion op built-in some completion should ideally come from piggieback and shadow directly, but I'm guessing it will take us a while to get there.

thheller 2021-04-06T07:29:49.164400Z

are there some docs for the nrepl messages going over the network for this?

thheller 2021-04-06T07:30:14.164800Z

always easier to look at the protocol than trying to reverse engineer the code

thheller 2021-04-06T07:32:14.165500Z

well realistically I don't have time to dig into this anyways but I'd be happy to help out answering questions if anyone needs help regarding the shadow-cljs parts

thheller 2021-04-06T07:32:52.166200Z

happy to add more official API methods if needed as well. don't go digging deep into internals like suitable did. I make no guarantees they won't break again.

bozhidar 2021-04-06T07:48:25.166600Z

The new ops that were added are https://nrepl.org/nrepl/0.8/ops.html#completions and https://nrepl.org/nrepl/0.8/ops.html#lookup

bozhidar 2021-04-06T07:48:48.166800Z

And here are some examples https://metaredux.com/posts/2020/06/15/nrepl-0-8-evolving-the-protocol.html

bozhidar 2021-04-06T07:49:43.167700Z

The basic idea was that if more essential ops were supported out of the box fewer people would need additional setup/middleware.

bozhidar 2021-04-06T07:50:57.168800Z

If shadow's middleware exposed those ops then shadow users would get some extra mileage without the need for cider-nrepl to be around.

bozhidar 2021-04-06T07:52:30.171200Z

(and at some point I'll likely stuff something similar in piggieback)

Bingen Galartza Iparragirre 2021-04-06T07:54:08.172200Z

Hi! I'm also having https://clojurians.slack.com/archives/C0617A8PQ/p1617373864130200 very same problem (`Symbol's function definition is void: seq-contains-p` when running cider-jack-in/`cider-connect`). I deleted the .emacs.d folder and reinstalled prelude, but it didn't help. I'm using Emacs 26.1 . Any idea what else could I try ?

bozhidar 2021-04-06T08:15:32.172700Z

@bingen.galartza You need to update the seq.el package to its most recent version.

Bingen Galartza Iparragirre 2021-04-06T08:21:05.174400Z

In my package list I see both seq 2.20 and 2.22 (which I guess is the latest). The first one is built-in and the seconds is installed by Prelude. Should I delete the old version? I'm quite a newbie with Emacs internals

bozhidar 2021-04-06T08:26:22.174700Z

Not sure that you can delete a built-in package, but I guess you can try.

Bingen Galartza Iparragirre 2021-04-06T08:30:07.175600Z

Ok, thanks, I will investigate

bozhidar 2021-04-06T08:32:38.176400Z

I've reverted CIDER to use the deprecated seq-contains just now. It seems it's better to have a deprecation message than to deal with all this breakage.

Bingen Galartza Iparragirre 2021-04-06T08:55:33.176600Z

Cool, thanks a lot

Bingen Galartza Iparragirre 2021-04-06T09:07:18.176900Z

Working like a charm. Thanks again

bozhidar 2021-04-06T09:58:11.178200Z

Not a problem. It broke CIDER's CI (lint error), so I replaced with member in the end. At least I remembered why I had changed the deprecated function in the first place. ๐Ÿ˜„

๐Ÿ‘ 1
dpsutton 2021-04-06T15:02:56.178400Z

๐Ÿ‘ 2
4
๐Ÿš€ 2
Karol Wรณjcik 2021-04-06T16:27:47.179100Z

Emacs for life! ๐Ÿ˜:the_horns::skin-tone-4:

๐Ÿ’ช 2
richiardiandrea 2021-04-06T23:24:27.180Z

we ๐Ÿชจ

๐Ÿ˜‚ 1