I have a lexer class like so
public class Lexer : ILexer {
...
public TextRange Parse(TextSnapshotRange snapshotRange, ILexerTarget parseTarget) { ... }
...
}
which works correctly, syntax highlighting works fine.
I also have a token reader class for parsing.
public sealed class SimpleTokenReader : TokenReaderBase {
...
public SimpleTokenReader(ITextBufferReader reader) : base(reader) { ... }
...
}
My question is, how can I construct a TextSnapshotRange and ILexerTarget from the variables I have to pass into the Parse method? Alternatively, what do I need to do to be able to populate my TokenBase classes with the correct data (so I can draw red squiggly lines under syntax errors etc).
Thanks