Liking cljdoc? Tell your friends :D

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.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close