Injected language context-aware (attribute schema type) syntax highlighting lexer


I'm implementing support for different XSLT schema types (xsl:avt, xsl:expression, xsl:sequence-type, xsl:mode, etc.) as a single language type that I'm using IFileElementType#doParseContents to work out the schema type for the lexer and parser. I'm then using this to use a different lexer start state when passed the default state. This is all working correctly, except for the syntax highlighting in the editor.

What I'm trying to figure out is how to get the injected language host element (XML attribute value) from the syntax highlighter factory, so I can then determine the schema type that I can pass to the lexer. I don't see a way of doing this, as the factory only provides the project and host file to the constructor -- I would like a version that passes the host element of the injected language for those contexts.

Ideally, I don't want to create a full language for each primary XSLT schema type (and eventually XML schema type), as this would be a lot of separate languages (19 for XMLSchema and ~4 or more for XSLT schema types).

Comment actions Permalink

Sorry this got lost. Is it still actual?


Comment actions Permalink

I ended up implementing separate languages to work around this and a few other issues, IIRC. Thanks.


Please sign in to leave a comment.