Hello, in a ClojureScript REPL, Cursive can't resolve any symbols. I had this problem on some older IntelliJ version as well, upgrading didn't help. Software information: IntelliJ IDEA 2024.3.2.1 (Community Edition) Build #IC-243.23654.153, built on January 23, 2025 Runtime version: 21.0.5+8-b631.30 amd64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.awt.windows.WToolkit Windows 11.0 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 8192M Cores: 20 Registry: ide.experimental.ui=true http://llm.show.ai.promotion.window.on.start=false Non-Bundled Plugins: com.andrey4623.rainbowcsv (2.0.2) com.verilang (0.1.8) nl.rubensten.texifyidea (0.10.0) com.github.copilot (1.5.32-242) com.cursiveclojure.cursive (1.14.0-2024.3) com.firsttimeinforever.intellij.pdf.viewer.intellij-pdf-viewer (0.17.0) Kotlin: 243.23654.153-IJ
that is usually a sign that Cursive can't see your dependencies, or those dependencies are missing clojure/clojurescript
make sure to enable any given aliases in Cursive when using deps.edn with aliases
Hmm, I've found the cause... It's in the clj/cljs switch on the right, for some reason, the language server doesn't switch to cljs mode after typing shadow/repl... Probably a bug? If I set the mode to cljs and then restart the REPL, the clj mode is back, but it stays that way.
But the REPL works, it just doesn't resolve anything from clojurescript...
@cfleming Can I get your view on this?
Are there any plans for Cursive to support LSP? I'm currently looking into integrating TypeScript language server into clojure-lsp, but I find Cursive user experience superior to clojure-lsp. JS/npm integration is something that many of us been asking for a long time, I know it's complicated, maybe adding LSP client to Cursive is doable and could serve as a point of extension?
> integrating TypeScript language server into clojure-lsp Can you elaborate @roman01la? Would it mean being able to use type information from TS classes in ClojureScript?
@grav Yes, this will require a mapping layer to generate JS from a sexp under cursor + turn ns requires into js imports. Once all of that is sent to TS server it will respond with a list of completion tokens
(.| js/document) -> document.|
(ns :require [react]) -> import * as react from "react"
(react/|) -> react.|type information can be also used to enrich inference in cljs code, this can be done in cljs compiler as well btw, not only in the editor
I see, you'd convert before calling LSP, interesting. I know a couple of plugin devs who are right down the LSP rabbit hole, I'll ask them for advice.
Correct. This should work for simple cases like the above, but more complex code where one location references the other one could be less straightforward
(let [x js/obj]
(.| x))
this requires parsing transforming potentially larger blocks of cljs, I’d try to infer JS only forms and skip everything else
Not sure how performant it’s going to be though Yes, I know this is a pain point and I'm planning to make another round of improvements here soon. The issue with LSP is that I don't think it exposes the functionality that Cursive needs, but I can look at it again. The same is true of the built-in IntelliJ JS functionality, it all relies on having source files that look roughly like JS/TS, so it works ok for something like Coffeescript but not for ClojureScript.