Fork me on GitHub
#cursive
<
2023-02-15
>
grav06:02:17

I usually create tests such as

(is (= nil (my-validate some-data)))
vs
(is (nil? (my-validate some-data)))
(where my-validate would return nil if everything is ok), since the former enables me to see a meaningful diff in Cursive/IntelliJ, if the test fails. However, in recent versions, I don't get a diff if either left or right side is nil. So I'd have to artificially change my test to something like
(is (= {} (my-validate some-data)))
to see the diff. Is this a regression?

cfleming06:02:46

A few people have reported this, I believe it’s a bug, I’ll try to look at it in the next day or two.

🙏 4
cfleming19:03:00

This should be fixed in a recent EAP.

thheller06:02:32

Hey, I'm thinking about writing an extension for IntelliJ. In it I would need an editor "component". I have not yet looked at all the documentation, but in general would it be possible to use Cursive for this? I mean just embed a regular editor but cursive paredit, etc works in it? would it also be possible to provide additional info so cursive can autocomplete precisely? ie. the ns, require aliases, etc?

cfleming08:02:30

So, yes, you should be able to do this, at least partially. Having your plugin depend on Cursive, and creating a Clojure editor where paredit etc will work should be easy. I don’t have a good way to add info for custom resolution, but something like that could be added.

cfleming08:02:56

I’d recommend doing it in either Java or Kotlin though, doing it in Clojure will unnecessarily complicate your life.

thheller09:02:31

not sure if I'll ever get around to actually doing this, but good to know it should be possible to at least get proper editing. thanks.

thheller10:02:28

weird question but in this context: I'm experimenting with something where you create files that are CLJ code but not quite CLJ namespaces. I'm abusing .clj files for that currently, just to get syntax highlighting and stuff

thheller10:02:52

problem is that I "sync files in REPL" a lot and cursive wants to include those files. any way I can prevent that?

thheller10:02:32

it already works if the file doens't contain in-ns or ns, but as soon as thats in there it seems to treat it as a clojure ns and wants to load it

thheller06:02:54

just a general yes or no is enough for now. details when I actually get to it. the alternative is just building a browser app and use clojure-mode, but I'd like it to be closer to my editor, as in be part of its UI