However, I find that in order to get it to work I also need to add the following line of code:
Just curious if there are any plans to extract this language map into a resource as well? Although not a big deal, it just seems that one shouldn't need to modify C# code to add support for a language.
ps. Thanks for creating this project! I can't tell you how useful it is to have an open-source code editor that integrates easily with .NET.
Feb 26, 2008 at 8:14 PM
Edited Feb 26, 2008 at 10:02 PM
This is a subject that really needs to be documented because it's confusing. This should hopefully give you a little more of a better picture, obviously you already know a lot of how this works.
"Languages" aren't really supported by the Native Scintilla control. A language is basically a named configuration with the Language name as the key. This concept was introduced with SCite, and almost all text editors based off of Scintilla uses some variation
of this concept. ScintillaNET also uses this concept and because of this the hosting applications don't have to worry about creating their own configuration implementations.
One of the components of a language configuration is the lexer. Lexers are the syntax parser code that provide the automatic coloring. Not every language has its own lexer specifically for its syntax, in fact most languages use a lexer that can also be used
The biggest difference between all of them is the list of keywords, which is fed into the lexer as another configuration item.
You can specify the lexer name in the config file like such:
<Lexer LexerName="cpp" />
Of course this doesn't actually modify the LexerLanguageMap buried in ScintillaNET's lexing class. The LexerLanguageMap is a lower level default mapping between languages and lexers. It's there for convenience so that you don't have to explicitly specify the