
I'm creating a new SyntaxLanguage by extending the SyntaxLanguage class. In my constructor, I want to register a lexer. I want the Lexer to be the same Lexer that's used by the XmlSyntaxLanguage. When I register using:
everything works as expected, such as syntax highlighting.
However, if I instead use:I don't get syntax highlighting. Can you explain why the former example works but the latter doesn't? What am I missing?
Thanks,
-Craig
RegisterService(new XmlSyntaxLanguage().GetLexer());
However, if I instead use:
var xmlClassificationTypeProvider = new XmlClassificationTypeProvider(AmbientHighlightingStyleRegistry.Instance);
xmlClassificationTypeProvider.RegisterAll();
var xmlLexer = new XmlLexer(xmlClassificationTypeProvider);
RegisterService(xmlLexer);
Thanks,
-Craig