editors

Discussion about all editors used for Clojure/ClojureScript
dpsutton 2018-03-28T00:06:05.000047Z

re switching cljs/clj for cljc files, CIDER by default evaluates the code to both connections. i don't like this feature at all

cfleming 2018-03-28T03:09:32.000130Z

@pez that looks very nice 🙂

1❤️
dpsutton 2018-03-28T03:20:17.000125Z

@cfleming how does cursive do evaluation in a cljc buffer?

pez 2018-03-28T04:26:19.000195Z

Both… it makes some sense, but I wouldn’t put it as the default.

pez 2018-03-28T04:35:00.000152Z

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.

seancorfield 2018-03-28T04:46:39.000204Z

@pez FWIW, I haven't used a (traditional/step) debugger in any language for maybe three decades.

cfleming 2018-03-28T06:24:05.000155Z

@dpsutton When you send a file, it just sends it to the currently selected REPL, whichever that is.

cfleming 2018-03-28T06:24:24.000087Z

But Cursive’s story for CLJS REPLs is embarrassingly lame right now.

cfleming 2018-03-28T06:27:24.000201Z

@pez A debugger is essential for me, I use Cursive’s one all the time.

cfleming 2018-03-28T06:27:57.000014Z

It’s particularly useful because the Cursive code isn’t pure Clojure, but I use it for pure Clojure code too (although less)

pez 2018-03-28T06:33:50.000043Z

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

pez 2018-03-28T06:35:25.000048Z

@cfleming: I'll have to consider adding debugger support, I guess. Do you know what the dependency requirements are for Cursive's debugger?

pez 2018-03-28T06:36:01.000157Z

Also, @cfleming, what is the mess with the CLJS REPL support?

cfleming 2018-03-28T06:36:30.000261Z

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.

cfleming 2018-03-28T06:37:41.000241Z

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.

cfleming 2018-03-28T06:39:32.000249Z

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.

cfleming 2018-03-28T06:40:10.000319Z

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.

pez 2018-03-28T06:40:13.000202Z

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.

pez 2018-03-28T06:40:53.000114Z

I'll stay away from JDPA, thanks for the warning! 😃

cfleming 2018-03-28T06:41:54.000239Z

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.

cfleming 2018-03-28T06:42:07.000138Z

Does Code have a Java debugger?

cfleming 2018-03-28T06:42:15.000106Z

Or an extension implementing that?

cfleming 2018-03-28T06:43:58.000011Z

Actually, it does - you might be able to use that.

cfleming 2018-03-28T06:45:12.000253Z

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.

pez 2018-03-28T06:45:59.000028Z

Link to that talk please!

cfleming 2018-03-28T06:46:16.000269Z

https://www.youtube.com/watch?v=ql77RwhcCK0

1❤️
cfleming 2018-03-28T06:46:31.000047Z

Feel free to ask if you have any questions.

pez 2018-03-28T06:47:00.000162Z

Thanks, I probably will.

pez 2018-03-28T06:49:59.000218Z

My extension can pretty print and run tests when hooked up to the cljs repl.

pez 2018-03-28T06:50:36.000314Z

Not sure what you mean with interactive test integration, though. 😃

pez 2018-03-28T06:52:21.000199Z

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.

dominicm 2018-03-28T06:55:17.000166Z

@pez I already have forgotten, are you using cider nrepl?

pez 2018-03-28T06:55:37.000244Z

Yes.

dominicm 2018-03-28T06:56:29.000139Z

Okay. I think the cider test output is very reasonable

pez 2018-03-28T06:57:55.000149Z

It is, I just need to figure out how to get the results out as they come in. Haven't investigated it much yet.

pez 2018-03-28T07:05:09.000275Z

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.

snoe 2018-03-28T07:05:43.000096Z

I’ve started on LSP server for clojure https://github.com/snoe/clojure-lsp if anyone is interested.

4🦜
pez 2018-03-28T07:09:32.000158Z

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

pez 2018-03-28T07:49:29.000096Z

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

dominicm 2018-03-28T09:07:55.000141Z

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

snoe 2018-03-28T12:38:11.000269Z

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