IChameleonElementType and language highlighting

I understand that IChameleonElementType is the right way to go if I want to inject a language in another, and that the main language has to return a single token of type IChameleonElementType for the entire subcontent of the other language. Now my question is how does the highlighting work in this case? I use two lexers for parsing and highlighting. For the highlighting is it enough if I return a IChameleonElementType with the adequate language?

2 comments
Comment actions Permalink

Have tried to use IChameleonElementType approach for my language injection, yet i am not able to get the highlighter to work. The embedded language does not get highlighted.

Do i need to implement LanguageInjector for this to work? I somehow fail to understand the coexistence of these two concepts.

0
Comment actions Permalink

Chameleon type helps in parsing of content, you need own
SyntaxHighlighter or Lexer that can process mix of the languages

Dan Cioca wrote:

I understand that IChameleonElementType is the right way to go if I want to inject a language in another, and that the main language has to return a single token of type IChameleonElementType for the entire subcontent of the another language. Now my question is how does the highlighting work in this case? I use two lexers for parsing and highlighting. For the highlighting is it enough if I return a IChameleonElementType with the adequate language?

---
Original message URL: http://www.jetbrains.net/devnet/message/5247978#5247978



--
Best regards,
   Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

1

Please sign in to leave a comment.