Fork me on GitHub
#cursive
<
2022-03-16
>
kennytilton12:03:59

Macros pulled in from a require are not resolving such that I can jump to their definition. Functions work OK in this regard. Macros do compile fine.

[tiltontec.mxweb.gen-macro
             :refer-macros [audio img input figure p a span div button br]
             :as mxw]
Originally the :as option was not being specified, but I tried it to match the doc example with gloss. No help. The doc says "When the caret is the head symbol of a macro form which is not handling the symbol resolution correctly, you'll see the intention lightbulb near the left margin and you can use ⌥↩️ to customise how that form is interpreted:" but all I get is an option to create a function of the same name. I made it to "Preferences>Languages & Frameworks>Clojure>Symbol Resolution" but that just says "Nothing to show" and offers no "+" button. Is this in fact doable? Thx!

cfleming00:03:50

How are those macros defined in tiltontec.mxweb.gen-macro? Is there a (defmacro audio [] ...) there somewhere, or are they autogenerated somehow?

kennytilton12:03:45

The macros are auto-generated, by a macro-writing macro. 🙂

cfleming20:03:24

So that’s the problem - Cursive has no way of knowing what those macros are. For libraries, this is handled by stub generation (https://cursive-ide.com/userguide/macros.html#stub-generation). However this currently only works for specific hard-coded namespaces. I have plans to allow you to specify namespaces which get this treatment, but initially at least they will probably only be from libraries, since the cache invalidation is very complicated otherwise.

👍 1