Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formalize/design/unit-test IDE-support API for macros. #10013

Open
nadako opened this issue Dec 19, 2020 · 1 comment
Open

Formalize/design/unit-test IDE-support API for macros. #10013

nadako opened this issue Dec 19, 2020 · 1 comment
Labels
Milestone

Comments

@nadako
Copy link
Member

nadako commented Dec 19, 2020

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.

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 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.
nadako added a commit that referenced this issue Dec 19, 2020
@nadako
Copy link
Member Author

nadako commented Dec 22, 2020

Some notable DSLs to consider:

@RealyUniqueName RealyUniqueName modified the milestones: Backlog, Design Dec 22, 2020
nadako added a commit that referenced this issue Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants