Esempio n. 1
0
        public PowerShellTokenizationService(ITextBuffer buffer)
        {
            Buffer                         = buffer;
            _classifierService             = new ClassifierService();
            _errorTagService               = new ErrorTagSpanService();
            _regionAndBraceMatchingService = new RegionAndBraceMatchingService();

            SetEmptyTokenizationProperties();
            SpanToTokenize = Buffer.CurrentSnapshot.CreateTrackingSpan(0, Buffer.CurrentSnapshot.Length, SpanTrackingMode.EdgeInclusive);
            StartTokenization();
        }
Esempio n. 2
0
        public PowerShellTokenizationService(ITextBuffer textBuffer)
        {
            _textBuffer                    = textBuffer;
            _classifierService             = new ClassifierService();
            _errorTagService               = new ErrorTagSpanService();
            _regionAndBraceMatchingService = new RegionAndBraceMatchingService();

            _isBufferTokenizing = true;
            _lastSnapshot       = _textBuffer.CurrentSnapshot;
            UpdateTokenization();
        }
        public void Init()
        {
            _service = new ErrorTagSpanService();

            _buffer = new Mock<ITextBuffer>();
            _bufferCurrentSnapshot = new Mock<ITextSnapshot>();
            _propertyCollection = new PropertyCollection();
            _spanToTokenize = new Mock<ITrackingSpan>();

            _bufferCurrentSnapshot.Setup(
                m => m.CreateTrackingSpan(It.IsAny<int>(), It.IsAny<int>(), SpanTrackingMode.EdgeInclusive)).Returns(_spanToTokenize.Object);

            _buffer.SetupGet(m => m.Properties).Returns(_propertyCollection);
            _buffer.SetupGet(m => m.CurrentSnapshot).Returns(_bufferCurrentSnapshot.Object);
        }