Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.07 KB

cursive.md

File metadata and controls

35 lines (21 loc) · 1.07 KB

Configuring Cursive to resolve the defn-spec macro

Cursive doesn't natively understand the defn-spec defn macro. However, you can use Cursive's symbol resolution to tell it to treat the macro like the Schema defn macro, which it does understand.

Setup steps

Write a stub function using the defn-spec macro:

(ns my.ns
  (:require [net.danielcompton.defn-spec-alpha :as ds]
            ; ...
            ))

(ds/defn adder :- int? [x :- int?]
  (inc x))

It will show up as unresolved, and won't indent like Clojure's defn.

Cursive unresolved

Click on the ds/defn text, wait for the lightbulb to appear, then click on it. Then click on "Resolve net.danielcompton [...] as..."

Cursive lightbulb

Then choose "Specify..."

Cursive lightbulb

Then choose "defn (in schema.core)"

Cursive lightbulb

🎉 You're all done! The adder function should now resolve correctly.