Fork me on GitHub
#cursive
<
2022-06-21
>
aratare04:06:07

Hello @cfleming, is Cursive currently supporting standalone scripts like Babashka’s? For some of the Java projects I work on, there are a few Babashka scripts. Since I’m using IntelliJ for these Java projects, I thought I could use Cursive for these scripts but currently various features like autocomplete and code formatting don’t work very well. If the answer to the previous question is no, do you have any future plan for this?

borkdude05:06:34

Have you tried adding a bb.edn file?

aratare05:06:30

@U04V15CAJ Not yet, but is that a requirement? I would like to keep things simple if possible.

cfleming05:06:45

@U013F1Q1R7G Have you added Babashka as a facet to the module? Info on how to do that is here: https://cursive-ide.com/userguide/babashka.html.

aratare05:06:44

@cfleming Ah I was an idiot for not checking out cursive doc first. It works beautifully now. Thanks a lot 🙂

👍 2
cfleming05:06:22

I'm glad to know it works for non-Clojure modules, I can't remember if I tested that or not.

cfleming05:06:38

I can't think of any reason why it wouldn't, but it's good to know.

folcon17:06:50

Just trying this out myself, is this expected to also cover pod support?

cfleming22:06:49

So, I'm not sure. I think pod deps are returned by bb when getting dependencies from bb.edn, but my knowledge of this is hazy.

folcon23:06:46

It's fine, @U04V15CAJ says they are only repl visible symbols. I've not looked at the source, but I'm assuming that they’re dynamically generated.

Jakub Holý (HolyJak)18:06:43

I am constantly fighting with the formatting in Cursive which differs from my colleague's Emacs, namely I'd like:

(:require
 [myapp :as x] ; <--- [ below : not below 'r' as Cursive wants

"edge" ;; comment ; <---- no extra space between the sexp and comment (whether ;; or ;)
Any tips? 🙏 The first can be fixed by "One space list indent" but it sets that also for many other places, which is undesirable.

mike_ananev19:06:51

Here is the example how to enable cljstyle inn IDEA https://bogoyavlensky.com/blog/clojure-formatting-cljstyle/

mike_ananev19:06:49

But I prefer not use it from IDEA, just run in terminal bb format before commit.

Jakub Holý (HolyJak)22:06:25

Thank you. Our experience is that cljstyle doesn't manage to format some things the way we need (mainly custom macros) 😭

cfleming08:06:36

The comment problem can be fixed using Preferences | Editor | Code Style | Clojure | General | Comment alignment column - set that to 0.

cfleming08:06:12

I don't think the requires can be formatted as you want without doing it globally using "One space list indent", though.