Fork me on GitHub
#cursive
<
2019-07-06
>
wilkerlucio01:07:35

hello, can someone help me figure how do I write a Java class and import it using Cursive? this may not be a cursive specific issue, but I wonder if Cursive can help in some way. I was expecting to be able to just write a class along with the clojure namespaces, but when I try to import it, it is like the class doesn't exists

wilkerlucio01:07:56

I posted on #clojure before, if someone please can give me some light https://clojurians.slack.com/archives/C03S1KBA2/p1562375761439100

Jakub Holý (HolyJak)17:07:30

What is common and worked for me was to have Java under another root folder. You just need to configure lein/... for it. https://github.com/technomancy/leiningen/blob/master/doc/MIXED_PROJECTS.md#source-layout

wilkerlucio18:07:02

thanks, I guess whats making my life harder is that I'm using deps.edn, but I got some help yesterday and made it work, there are more details in the #clojure discussion, thanks for the lein hint

dominicm03:07:03

Using the cursive-started nrepl, is it possible to configure additional middleware. In particular, piggieback?

cfleming03:07:42

@dominicm Not yet, but it will be very shortly.

dominicm03:07:56

@cfleming I should probably have mentioned "deps.edn" at the same time 😄 Will this new feature support some kind of "injection". Would it be possible for aspiring cursive-compatible templates to place a file somewhere (in .idea or something) that will instruct cursive on what middleware and dependencies to inject?

cfleming03:07:00

Umm, maybe - I haven’t gone far enough down the rabbit hole yet to know that, but I’ll keep that use case in mind.

cfleming03:07:45

Currently Cursive injects nREPL itself, and for piggieback it probably makes sense to bundle and inject a compatible version.

cfleming03:07:14

I’ll also shortly be adding dual clj/cljs REPLs to make all this easier.

dominicm03:07:16

That would be good too. One drawback is that currently piggieback blows up if cljs isn't present (due to a tools.reader thing)

cfleming03:07:27

Ugh, that sucks.

dominicm03:07:30

Although, cursive knows if it's a cljs project.

cfleming03:07:41

I don’t want to bundle cljs

dominicm03:07:42

I think it can be worked around with some dynamism, but I haven't tried yet.

dominicm03:07:07

Maybe if I work on that, it'll make it easier for you to bundle 🙂

cfleming03:07:30

Cursive does include Maven download functionality, so perhaps the best option is not bundle at all and download specified versions as required.

dominicm03:07:17

Cursive analyzes the whole deps tree doesn't it?

cfleming03:07:54

I can check if CLJS is on the classpath, yes, if that’s what you mean.

dominicm03:07:52

Basically, yeah. But you know that before starting nrepl. Would that be a good way to determine whether to include piggieback?

cfleming03:07:09

It would certainly be a good cue to suggest it, yes.

cfleming04:07:18

I’m planning to try to figure out how best to handle CLJS in all its REPL forms next week. Apart from the technical challenges, it’s a fearsome UI problem.

dpsutton04:07:32

Does piggieback blow up without cljs in cursive or in general? Ive been wanting to get in there and that would be a great first issue

dominicm04:07:12

in general.

dominicm04:07:27

@dpsutton I've just finished the patch for making it not blow up

dominicm04:07:49

https://github.com/nrepl/piggieback/pull/107 Your review would be valuable of course 🙂

dpsutton05:07:15

That’s a hell of a diff :)

dominicm05:07:08

It's mostly just moving code from A to B. git just gets a little confused because of the prefixing.

dpsutton05:07:51

Yeah I was glancing at it. It’s too late tonight here but I’ll try it out and look on Sunday

wilkerlucio13:07:31

I've been using deps for some time now, one feature I miss from Lein is that since deps Cursive can't figure the test roots because this is not supported by deps. Makes sense in terms of Clojure, but I was wondering if would be useful to also have some special key to tell Cursive (or any other editor) which as the test roots, this is useful for things like navigating to tests or creating new tests. what you think we use some custom keys on deps.edn to let Cursive knows which are the tests roots? maybe :cursive/test-paths, or :editor/test-paths, something in this direction

minhnn15:07:43

can I delete a expr without saving it to clipboard ?

cfleming22:07:46

@wilkerlucio Cursive will mark as a test root any source path that comes from an alias containing “test”.