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

            _isBufferTokenizing = true;
            _lastSnapshot       = _textBuffer.CurrentSnapshot;
            UpdateTokenization();
        }
Esempio n. 2
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();
        }
        public void Init()
        {
            _classificationRegistry = new Mock<IClassificationTypeRegistryService>();

            _variableType = new Mock<IClassificationType>();
            _variableType.Setup(m => m.Classification).Returns("variable");
            _classificationRegistry.Setup(m => m.GetClassificationType(Classifications.PowerShellVariable)).Returns(_variableType.Object);

            _stringType = new Mock<IClassificationType>();
            _stringType.Setup(m => m.Classification).Returns("string");
            _classificationRegistry.Setup(m => m.GetClassificationType(Classifications.PowerShellString)).Returns(_stringType.Object);
            
            EditorImports.ClassificationTypeRegistryService = _classificationRegistry.Object;
            _classifierService = new ClassifierService();
        }