This question is related to the plugin article found at http://www.jetbrains.com/idea/plugins/developing_custom_language_plugins.html.
I am trying to get highlighting working correctly for a custom language (its a config language that generates Java code) that can have bits of Java embedded directly into it (by bits I mean anything at the class level, eg fields, methods, constructors). The article above makes it sound like having my lexer create a single instance of IChameleonElementType that holds all of the text is enough however I hit the following assertion:
'Assertion failed: ParserDefinition.createElement() may not return null '
The IChameleonElementType that I am using was created as:
private static final Language JAVA_LANGUAGE = ((LanguageFileType) FileTypeManager.getInstance().getFileTypeByExtension( "java" )).getLanguage();
new IChameleonElementType( "embedded java", JAVA_LANGUAGE );
I then have the lexer return all of the java code as a single token of this type. As far as I can tell, it is the parser created by JAVA_LANGUAGE that is returning null which leads me to think that I should be using a different element type.. sadly this is where I've head a road block with my thinking.
Thanks in advance for any pointers,