Fork me on GitHub
#calva
<
2023-02-12
>
mjhika21:02:18

myabe i'm missing something in Calva, but does calva offer js code completion from cljs projects?

pez21:02:54

Yes. How do you start the REPL?

mjhika21:02:02

I started my repl using shadow-cljs

pez21:02:50

Can you describe the steps you take to start the REPL?

mjhika22:02:07

OH yes my bad. In short, i'm just using jack-in to launch a build from my shadow-cljs.edn I am managing the project through shadow-cljs in that i'm using the shadow-cljs.edn to configure my project. I'm installing three.js through npm and then using the jack-in command from calva to start a new shadow-cljs repl using a build i have configured in my shadow-cljs.edn. the build is using my ns as its :entries calling a render-fn as the :init-fn. My goal was to only have to interface with calva when launching my project so i don't need to use the shadow-cljs web console to watch/compile builds

pez22:02:17

Thanks! Well, then you should have code completions. It's not perfect, and some constructs don't work, for reasons I have not fully understood. But threading should work. Try:

(-> js/document
    .|)
| represents the cursor.

mjhika00:02:27

Mm that did make it work! Okay well then good to know that I can get it working with threading macros. I tried it out with doto and that worked as well.

mjhika00:02:40

Thanks for the help

🙏 2