At the moment, the extension system is very tied to Cursive and to IntelliJ internals. Several people have asked whether I could extract the functionality so it would be reusable, but since I haven't even had time to get my own API public yet this is unlikely to happen - it's a very significant piece of work.
The key idea is to have extensions for forms. These extensions are keyed off the head symbol of lists, which is fully qualified. This means that I can have separate extensions for clojure.core/defn and schema.macros/defn, which is critical. However this relies on reliably being able to resolve symbols, which is non-trivial in source. If you're willing to macroexpand everything this may be easier. I also have a parsing framework which I use to describe grammars for individual forms, which makes form parsing and data extraction much much easier. See the Illuminated Macros talk for a similar approach. Things that extensions can currently do: 1. Describe var metadata for global symbols (vars) 2. Describe local bindings (what their scope is, what their type is, etc) 3. How to extract the arglists from a particular form 4. Whether the form is a threading form, and how to interpret it if so. 5. Various extensions for parsing namespace relationships (imports, refers, aliases) 6. Whether the form declares a namespace. 7. Various things relating to testing - does this form describe a test, etc. Things that they'll do soon: 1. Describe the type of the form, for Java interop type inference (almost done) 2. Allow customisation of code completion at various points in forms. Much of this is specific to editing environments, and more concretely specific to Cursive. It's also mostly necessary because I'm working from unexpanded source rather than introspecting a REPL. Cheers, Colin On 25 May 2015 at 20:49, Richard Möhn <richard.mo...@posteo.de> wrote: > > > Am Freitag, 22. Mai 2015 11:09:40 UTC+9 schrieb Colin Fleming: >> >> On one of the latest Cognicasts, Colin Fleming talked about a repo where >>> library authors can upload extensions that help the IDE understand their >>> macros. I have to listen to it again, but it sounded a bit like what you're >>> talking about. Right now I can't find that repo, though. Maybe he was just >>> talking about plans. >>> >> >> Right, sadly this is still at the plans stage, although Cursive already >> uses this API internally. I'll let everyone know when this is public. >> > > Hmm, do you think it would be realistic to have a common format? Maybe you > could tell me how your extensions look like, so that I can take it into > account when developing my model? However, I know that publishing things > can be "dangerous", so I'd absolutely understand if you want to keep this > to yourself for now. > > Richard > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.