My EXML plugin (sources in this git repo) uses a special XML format (much like MXML) that contains inline ActionScript code. I managed to set up language injection to do syntax highlighting and completion correctly, but I would like the "import class" intention to be handled differently. Currently, the import statement is inserted directly at the start of the code fragment, but in EXML, imports are supposed to be top-level XML elements.
I'm a bit lost where to start. The Flex plugin must handle MXML in a similar way, so there must be a way to do this.
Any hint / pointer would be appreciated!