Right now just made working version based on heaps and flash backends, still missing event listeners for components, but other attributes are working fine. Will try to clean up and add missing features in near future
During development found some issues with inline markup for haxe 4, it is not working if haxe formatter is working on save for vscode, as it adds spaces between tags and compiler fails to compile. Also found some issues with lix and lime extensions in vscode, as could not get the working together, all the time lime was not found so righ now for testing purposes, you need to launch it manually from terminal to compile test app. Will try to investigate more on these issues. On more thing could not get code hinting working for inline markup components, not sure if its even implemented yet.
Please open an issue with a reproducible example (can be link to a repo).
There some support for autocompletion in strings. As for inline markup, I haven’t even tried. One of many issues is that VSCode doesn’t have any concept of inline markup, so it doesn’t know when to provide completion.
that only works if the file’s contents are somewhat parseable, because formatter will still try to build a tokentree holding everything in memory before writing a formatted file (and skipping excluded sections).
I wouldn’t recommend using formatter on files with inline markup, if you can exclude them completely.
Regarding issues with lix and lime there are some discussion already, but basically can not invoke lime from lix, could be because lime sets global variables
For events now think what would be the best approuch as feathers uses add/remove event, so need to create new attributes with macro that can add these events, just not sure if its possible to add only valid events as then need to have some mapping events → component, or just add all of them for every component
I tested in a macro, and I was able to read all of the events on a class like this:
var eventMeta = theClass.meta.extract(":event");
for (meta in eventMeta) {
var constant = meta.params[0];
var type = meta.params[1];
var eventName = ExprTools.getValue(constant); // example: change
var typeName = ExprTools.toString(type); // example: openfl.events.Event
}
Side note: I tried using a single expression, like the one below, but I couldn’t for the life of me figure out how to make a macro resolve the original string value.
@:event(openfl.events.Event.CHANGE) // not sure how to resolve
You will need to check the super classes for @:event metadata too. For instance, FeathersControl has metadata for the “initialize” event, but its subclass Button does not because that would be redundant.
Any events inherited from classes like openfl.display.Sprite won’t have @:event metadata, so to expose those events, you’ll need to hard-code them. That should be a lot easier than trying to hard-code the Feathers UI events, though.
Got first success, parsed events and now can call them, still support only trigger for button but will add other types as well, will think how to explain renderer what are events and what not