I am attempting to create manual parse requests according to your documentation. Code from your documentation is below. Instead of creating a ParseRequest object with a reader I provided an ISyntaxLanguage (as recomended in your doc). Inside my parser the Parse method gets called just like I expect. The problem is my parser uses an ITextSnapshotReader to do its parsing (this makes sense right? A parser should/can use the output of a lexer) and it is null. Specifically, the call IParseRequest.Snapshot.GetReader(0) returns null. How do I manually parse when the parser needs a reference to a ITextSnapshotReader?
Thanks
// Create the request
string sourceKey = @"c:\myfilename.txt";
ITextBufferReader reader = new StringTextBufferReader("Text to parse");
IParser parser = new MyTextParser(); // Some class implementing IParser
IParseTarget parseTarget = this; // Assuming class that executes this code implements IParseTarget
IParseRequest request = new ParseRequest(sourceKey, reader, parser, parseTarget);
request.Priority = ParseRequest.LowPriority;
// Queue the request
if (AmbientParseRequestDispatcherProvider.Dispatcher != null)
AmbientParseRequestDispatcherProvider.Dispatcher.QueueRequest(request);