Hi all,

I work on Cursive <https://cursive-ide.com>, which is an IDE for Clojure
code based on IntelliJ. I've spoken to several of you at various
conferences over the years.

I'm interested in understanding better how the macroexpansion to support
editor functionality in DrRacket works. By contrast, Cursive doesn't expand
macros during editing and relies on an extension API to teach it about
macro semantics. It's not ideal, but it does have some advantages - it's
safe and it's fast, and you can add support for some really crazy things
that macros do. However currently it requires me to add support for popular
macros, although I do have plans to open source that part so that users
will be able to add support for either third-party macros that they use, or
macros that they've developed themselves.

My understanding is that using macroexpansion in the way that DrRacket does
requires a fairly deep integration between the macroexpander, the macros
themselves and the IDE - is that a fair statement?

I guess that things like source location for forms which are carried from
the unexpanded source to the macroexpansion are more or less automatic. How
does this work for synthesised forms which are either composed from forms
in the original source, or don't exist in the original source at all? For
example, playing around with DrRacket I can see that after (struct node
([left : Tree] [right : Tree])), hovering over node-left or node-right will
indicate that the node part comes from the struct definition, and the
left/right part will come from the fields. Are there annotations specifying
partial ranges within symbols to allow this?

I know there are features for tagging forms with information that will
appear in tooltips and the like, e.g. Typed Racket showing type information
in the editor. Are there other facilities for communicating with the user?

How well does all this work for macros which aren't written with DrRacket
in mind?

And finally, of course - is there some documentation about all this I could
look at? Is this all implemented with syntax object properties
<https://docs.racket-lang.org/reference/stxprops.html>?

Thanks for any and all help!

Cheers,
Colin

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CACK23AdoqzzPmUz9QC%2BL9i3S5S%2Bdq23f2WOJbsSHMYq6Zfb4_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to