Fork me on GitHub
#cider
<
2022-08-16
>
solf16:08:29

Does CIDER provide js autocompletion with clj-suitable and shadow-cljs? The README says no: https://github.com/clojure-emacs/clj-suitable#emacs-cider But the issue referenced seems closed/fixed *Edit*: After poking everywhere in the stack (cider, cider.piggyback, suitable.js_introspection, …) it’s now working. But I haven’t actually changed anything so I’m a bit worried it just randomly started working. I see js_introspection being loaded when I try to auto-complete

shadow-cljs: load JS cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs
I which I think I didn’t see before

solf18:08:49

Oh, after reloading the page, completion doesn’t work

solf18:08:59

and the message doesn’t appear anymore in the console

solf18:08:14

that seems like an easier problem to solve

solf18:08:51

Now I can’t find how to show that shadow-cljs: load JS ... message again

solf18:08:12

But if I manually eval the functions inside cider.nrepl.inlined-deps.suitable.v0v4v1.suitable.js-introspection completion works on emacs

chrisetheridge18:08:54

@U7S5E44DB do you use clojure-lsp or solely CIDER?

solf18:08:52

only cider

chrisetheridge18:08:13

ah okay. i'm trying to get this to work myself too, but i use lsp. going to try the eval trick you did

solf18:08:01

Loading the file via normal means doesn’t work, but I don’t know enough about load-file to know if that’s expected:

(cljs.core/load-file "/Users/solf/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs")
  FileNotFoundException: /Users/solf/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs (No such file or directory)

vemv18:08:22

"/Users/solf/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs"
is not a file (note the jar: bit) if you find a trick feel free to mention it in the issue you linked. Other than that most things related to suitable and shadow-cljs are not quite maintained 😞 someone who actively uses those would ideally step up

vemv18:08:34

(I contributed some things to Suitable, but I just don't use cljs at work so it's harder for me to maintain a motivation)

solf18:08:10

I noticed it’s in a jar, but then it’s a mistery how shadow-cljs managed to load it at some point

shadow-cljs: load JS cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs

vemv18:08:43

probably because it's a resource

solf18:08:47

Yeah, I’m probably missing some basic information about how shadow / cljs work 🙃

solf18:08:16

It’s so close to working though!

solf18:08:52

I just need to find how that file is supposed to be loaded

vemv18:08:55

if you get stuck feel free to create an issue in suitable and cc/ the Shadow author (`@thheller`) i.e. if you solve this, just mention it in https://github.com/clojure-emacs/clj-suitable/issues/15; if you don't, create a new issue

👍 1
Brian Marco21:08:00

I am trying to use

((clojure-mode . ((cider-clojure-cli-aliases . "-A:dev"))))
in .dir-locals.el to inject an alias for cider-jack-in. it doesn't work, but there is no error either

Drew Verlee02:08:36

That looks right to me. Try restarting emacs to make sure it has taken effect. In spacemacs i can do SPC o R to rever the buffer and that seems to work (though it might have some cases where it doesn't).

Drew Verlee02:08:09

err maybe you dont need the first "." with clojure-mode?

Drew Verlee02:08:37

((nil . ((cider-clojure-cli-aliases . "-A:dev"))))
nil just means "match any mode" so if you only use it for clojure it will behave the same

Drew Verlee02:08:31

this website is helpful, your dir-locals.el looks fine based on the examples and what i use as well... https://practical.li/spacemacs/clojure-projects/project-configuration.html

Brian Marco16:08:25

It actually did work after restarting emacs. I didn't realize .dir-locals.el wasn't reread every time i reran cider-jack-in. I had been restarting emacs so many times I just sort of assumed I had tried that already.

Brian Marco16:08:56

what does the . do in elisp btw?

Drew Verlee16:08:39

I'm not sure why the list syntax isn't used

Brian Marco21:08:37

I very much don't know any elisp so apologies