/// <summary> /// Parses the specified text buffer. Continues to monitor the parsed buffer and updates /// the parse tree asynchronously as the buffer changes. /// </summary> /// <param name="buffer"></param> public BufferParser EnqueueBuffer(IProjectEntry projEntry, ITextView textView, ITextBuffer buffer) { // only attach one parser to each buffer, we can get multiple enqueue's // for example if a document is already open when loading a project. BufferParser bufferParser; if (!buffer.Properties.TryGetProperty<BufferParser>(typeof(BufferParser), out bufferParser)) { Dispatcher dispatcher = null; var uiElement = textView as UIElement; if (uiElement != null) { dispatcher = uiElement.Dispatcher; } bufferParser = new BufferParser(dispatcher, projEntry, _parser, buffer); var curSnapshot = buffer.CurrentSnapshot; var severity = JToolsPackage.Instance != null ? JToolsPackage.Instance.OptionsPage.IndentationInconsistencySeverity : Severity.Ignore; bufferParser.EnqueingEntry(); EnqueWorker(() => { _parser.ParseBuffers(bufferParser, severity, curSnapshot); }); } return bufferParser; }
internal void SetBufferParser(BufferParser bufferParser) { _bufferParser = bufferParser; }
public MonitoredBufferResult(BufferParser bufferParser, IProjectEntry projectEntry) { BufferParser = bufferParser; ProjectEntry = projectEntry; }