
Hi, I'm pretty new to Actipro, and I'm currently evaluating SyntaxEditor as part of a feasibility test before my team considers subscribing.
Right now, I'm trying to achieve basic syntax highlighting (changing word colors) without using the Language Designer, since I need a high level of customization later on. I believe it's important to fully understand and control the creation of a custom lexer and language definition.
I've gone through the Sample Browser, but I found it a bit hard to follow. So I'm using ChatGPT to help me build a minimal working sample. Unfortunately, I’m stuck on this part of the code — it’s not working as expected:
public class FaizLangLexer : MergableLexerBase
{
public ILexicalState InitialState => null;
public IToken ScanToken(ITextSnapshotReader reader, IMergableToken state)
{
string a = reader.PeekText(2);
if (reader.IsAtSnapshotLineStart && reader.PeekText(2) == "//")
{
reader.ReadCharacterThrough('\n');
return new TextSnapshotToken(FaizLangClassificationTypes.Comment, reader.TokenText);
}
reader.ReadCharacter(); // default: read single character
return null;
}
}
If possible, could you provide a complete but minimal working sample of a custom lexer that supports syntax highlighting, just as a reference? That would help me a lot.
Thank you very much!
Best regards,