-
Notifications
You must be signed in to change notification settings - Fork 10
Allow @HtmlImport() without library directive #40
Comments
In |
I definitely agree this would be nice |
cc @sigmundch So actually this is a bit more complicated that it would first appear. This is an Currently only libraries, top level methods, and classes are supported. We could certainly add support for annotating imports, but I think probably the most reasonable solution here would be two fold:
This would also have the benefit of allowing people to move their |
Yeah, this unfortunately requires some extra changes in initialize like @jakemac53 suggests.
I guess it could be possible to add to the ImportDescriptor some details about the enclosing library or even a pointer to a LibraryDescriptor, right? |
Yes but that would just enable it to work for imports. I don't like the idea of adding a LibraryDescriptor just for that case and not others, hence the idea of a different Initializer type which always gets a LibraryDescriptor in addition to the regular things. |
Right now, that annotation will only be found on a library directive. Given that those directives are otherwise not very useful, it would be nice if users could omit them.
This probably means looking for
@HtmlImport
before any directive and, if there are none, on the first declaration in the file. I believe the test package does something similar for@TestOn
, so @nex3 is a good person to ask about this.The text was updated successfully, but these errors were encountered: