You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment nobody really understands how to add support for completion, go-to-definition and other IDE services in a macro. There are things like EDisplay and Context.containsDisplayPosition, but currently they more or less feel like just leaked internals without any documentation or reliably specified behaviour.
This makes creating and, more importantly, using macro-powered DSLs rather painful and I think we could improve the situation, so I'm creating this issue in hope to get some discussion going and gather ideas.
Some initial thoughts:
EDisplay node generally makes sense to me, although I think it could contain exact cursor position. This seems useful in cases when we have EDisplay(EString("some unknown DSL")) and we want to know exactly where to insert a new EDisplay from a macro when generating expressions.
Maybe we should have macro API to directly "raise" display results instead of adding EDisplay values to be processed by the typer.
For DSLs we often want to generate custom syntax (e.g. <tagname attr="value"> in HXX), we need some way for a macro to return a list of those, but I'm not sure how structured should it be.
What's EDisplayNew? Seems like a leftover that we should remove to avoid confusion.
The text was updated successfully, but these errors were encountered:
At the moment nobody really understands how to add support for completion, go-to-definition and other IDE services in a macro. There are things like
EDisplay
andContext.containsDisplayPosition
, but currently they more or less feel like just leaked internals without any documentation or reliably specified behaviour.For example, I just added some go-to-definition support to tink_hxx, but I have no idea if this is really correct or whether it will break with one of the next haxe updates.
This makes creating and, more importantly, using macro-powered DSLs rather painful and I think we could improve the situation, so I'm creating this issue in hope to get some discussion going and gather ideas.
Some initial thoughts:
EDisplay
node generally makes sense to me, although I think it could contain exact cursor position. This seems useful in cases when we haveEDisplay(EString("some unknown DSL"))
and we want to know exactly where to insert a newEDisplay
from a macro when generating expressions.EDisplay
values to be processed by the typer.<tagname attr="value">
in HXX), we need some way for a macro to return a list of those, but I'm not sure how structured should it be.What'sEDisplayNew
? Seems like a leftover that we should remove to avoid confusion.The text was updated successfully, but these errors were encountered: