defn and friends not recognised in CLJS buffers (Shadow-CLJS, deps.edn)
gerdint opened this issue · comments
Cursive appear to be confused over basic CLJS forms for me (see screenshot). I am aware that Shadow-CLJS support is spotty but is it really the case that unresolved deps break basic language forms like defn
? (and with that its indetation rules etc). I have my CLJS deps managed via Shadow's deps.edn support, as this will make Cursive resolve the non-NPM ones it seems.
I use IntelliJ IDEA 2023.3.4+Cursive 1.13.1-2023.3
@cursive-ide Do you need more info here (deps.edn or such?) or have any idea of what's up?
@gerdint There's a section in the doc dealing with problems like this: https://cursive-ide.com/userguide/troubleshooting.html#help-lots-of-symbols-don-t-resolve. In your case, I suspect the project is not added correctly (step 3). Could you check that and let me know what you find?
@cursive-ide I checked the stuff in the user guide and no progress. It's a full-stack project and all the CLJ files are fine.
As you can see some stuff in the above CLJS file is resolved, but odd that core forms like 'defn' and 'let' are not I think.
Could you try File | Cache Recovery | Repair IDE and follow the steps there to see if that helps?
If not, could you send a screenshot of your deps toolwindow with the dependencies expanded?
What I don't see in that list is ClojureScript itself. If you go to File | Project Structure, then choose Modules and select your problematic module, does it have the ClojureScript library attached under Dependencies?
Good catch! I put shadow-cljs with its dependancy on clojurescript under a cljs alias in my deps.edn, which was not selected in the deps aliases sidebar. I selected it and now all the core CLJS forms are indeed resolved! Now it's just the NPM deps and DOM API functions which are not resolved, and there are already existing issues for that I believe. Cheers!
@cursive-ide Some more docs on how to work with CLJS projects (such as the Shadow deps.edn hack) would be good I think (though I admit that in this case I was pretty stupid).