public OutlineTagger(ITextBuffer buffer)
        {
            _buffer   = buffer;
            _snapshot = buffer.CurrentSnapshot;
            _regions  = new List <Region>();

            ReparseFile(null, EventArgs.Empty);

            // listen for changes to the buffer, but don't process until the user stops typing
            BufferIdleEventUtil.AddBufferIdleEventListener(_buffer, ReparseFile);
        }
Esempio n. 2
0
        internal ErrorTagger(ITextBuffer buffer, IBufferTagAggregatorFactoryService aggregatorFactory, IServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactory)
        {
            _buffer = buffer;

            _aggregator = aggregatorFactory.CreateTagAggregator <PkgDefTokenTag>(buffer);

            if (!textDocumentFactory.TryGetTextDocument(_buffer, out _document))
            {
                _document = null;
            }

            _errorProvider = new ErrorListProvider(serviceProvider);

            ReparseFile(null, EventArgs.Empty);

            BufferIdleEventUtil.AddBufferIdleEventListener(_buffer, ReparseFile);
        }