Fork me on GitHub
#cursive
<
2023-06-05
>
steveb8n02:06:19

Q: is there a way to configure Cursive to understand defn macros? e.g. here it is confused by the arity

cfleming02:06:32

I think you should be able to configure that to resolve as the Schema defn.

steveb8n06:06:52

yes I’ve already set the “resolve as” and that changes the auto-formatting so I know it’s working

steveb8n06:06:41

but I’m guessing that the built in static analysis is confused by the :- syntax and thinks it’s > 1 arity

cfleming06:06:03

Hmm, it’s been a while but I think the schema syntax should match that.

cfleming06:06:11

I’ll take a look.

steveb8n06:06:15

since it’s the same syntax as plumatic schema I’m hoping there’s a way to make it understand

steveb8n06:06:20

thank you 🙂

steveb8n06:06:28

I can ignore it but thought I’d ask

cfleming06:06:40

Just checking - you told it to resolve as the schema defn, right? Not the normal one.

steveb8n06:06:19

oh no, I didn’t spot the distinction. let me check

steveb8n06:06:06

I don’t think I have the schema lib in my classpath, only Malli. Can I use schema/defn despite that? I’ll see if that works

steveb8n06:06:42

yes! that works

steveb8n06:06:16

I can use “specify” and choose schema/defn and it groks the syntax

👍 2
steveb8n06:06:35

tested incorrect arity and that works too

steveb8n06:06:42

much appreciated

steveb8n06:06:03

I just renewed my Cursive license today btw. already got my $ worth 🙂

clojure-spin 2
cfleming06:06:26

great news 🙂

Tarmo Petrovits06:06:12

Hey, I’m using Intellij IDEA with Cursive and the project is set up with shadow-cljs, but for some reason, it’s not able to resolve HELIX defonce defn defnc , etc macros. Has anyone solved that problem?

cfleming06:06:23

How are they defined in the Helix source code?

cfleming06:06:53

Looks like you could hopefully just resolve that as defn: https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution

2