editors 2018-03-28

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.

🦜 4

You may be interested in speaking to @thheller who started to explore this already a while back.

@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. šŸ˜„)

@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.

1

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 šŸ™‚

ā¤ļø 1

@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.

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?

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.