re switching cljs/clj for cljc files, CIDER by default evaluates the code to both connections. i don't like this feature at all
@pez that looks very nice š
@cfleming how does cursive do evaluation in a cljc buffer?
Bothā¦ it makes some sense, but I wouldnāt put it as the default.
How important is a debugger to you guys? There is another extension that has that, but I have never gotten it to work. Right now focusing on the interactive programming for this extension.
@pez FWIW, I haven't used a (traditional/step) debugger in any language for maybe three decades.
@dpsutton When you send a file, it just sends it to the currently selected REPL, whichever that is.
But Cursiveās story for CLJS REPLs is embarrassingly lame right now.
@pez A debugger is essential for me, I use Cursiveās one all the time.
Itās particularly useful because the Cursive code isnāt pure Clojure, but I use it for pure Clojure code too (although less)
It's worth a lot @seancorfield! I seem to manage quite well without debugger in Clojure, because Interactive Programming, I think. But I wouldn't come far with Clojure 4 VS Code without a debugger! Mostly because it is written i Javascript (I'm thinking of porting it to TypeScript, wasting to much time right now).
@cfleming: I'll have to consider adding debugger support, I guess. Do you know what the dependency requirements are for Cursive's debugger?
Also, @cfleming, what is the mess with the CLJS REPL support?
Well, Cursive just uses IntelliJās one, but that dependency comes for free because Iām building on IntelliJ. It uses JDI/JDPA under the hood.
Cursive doesnāt have a built-in CLJS REPL right now, just a clojure.main one that you can use to bootstrap a CLJS one. That rules out a lot of the nice functionality that the CLJ REPL has, like interactive test integration, pretty printing of results etc.
I think your best approach would be to integrate the CIDER debugger into Code. Writing a JDPA client from something not running on the JVM is going to be really painful.
The CIDER one arguably works better than Cursiveās for pure-Clojure code since itās not line based, but doesnāt work at all for e.g. stepping into Java deps.
I see, in my case the user has to start the CLJ REPL and then bootstrap the CLJS one on top of that. Then the extension finds the respective sessions using CIDER.
I'll stay away from JDPA, thanks for the warning! š
Itās not that JDPA is bad, but writing a client without using JDI (the Java client on top of the socket protocol) is likely to be a ton of work.
Does Code have a Java debugger?
Or an extension implementing that?
Actually, it does - you might be able to use that.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug
If you decide to investigate going down that road, I recommend watching my talk on the Cursive debugger, I talk a lot about the various pitfalls of line-based debugging with Clojure code.
Link to that talk please!
Feel free to ask if you have any questions.
Thanks, I probably will.
My extension can pretty print and run tests when hooked up to the cljs repl.
Not sure what you mean with interactive test integration, though. š
A problem my extension suffers from badly right now is that it only reports when all tests are run, which does not work for the project I am working in right now. That and I need to implement the rerun test Cider feature.
@pez I already have forgotten, are you using cider nrepl?
Yes.
Okay. I think the cider test output is very reasonable
It is, I just need to figure out how to get the results out as they come in. Haven't investigated it much yet.
I do mark any test failures in the editor, though. š So running namespace tests is still very productive. I run both the tests in namespace and any conventionally named test namespace. Not sure how Emacs does that. The reason I am even using VS Code is that my little machine does not cope well with Emacs, so it is hard for me to try things out there.
Iāve started on LSP server for clojure https://github.com/snoe/clojure-lsp if anyone is interested.
@snoe I am! I'm pretty new to the concept of LSPs though, can you share what use cases you see for a Clojure one?
@cfleming: So given that I might be able to use that Java debugger somehow. From a user perspective, which one do you think is to prefer? (I understand that stepping into Java deps must be extra convenient for you. š)
You may be interested in speaking to @thheller who started to explore this already a while back.
@pez Cool!. Find usages, renames across a project, and auto-requiring namespaces are the big ones I miss in vim. And then, I also feel that not having to query the repl for these things; in the Cursive way rather than the Cider way (for me) eliminates a number of headaches.