public ScriptCompletionReplacementSource(ITextBuffer textBuffer)
        {
            _textBuffer = textBuffer;

            if (textBuffer.ContentType.TypeName.Equals("HTML", StringComparison.OrdinalIgnoreCase))
            {
                _lbm = VsServiceManager.GetLanguageBlockManager(textBuffer);
            }
        }
示例#2
0
        public ScriptCompletionWatcher(IWpfTextView view, ICompletionBroker broker)
        {
            _textView = view;
            _broker   = broker;

            var htmlBuffers = view.BufferGraph.GetTextBuffers(tb => tb.ContentType.TypeName.Equals("HTML", StringComparison.OrdinalIgnoreCase));

            if (htmlBuffers.Any())
            {
                _lbm = VsServiceManager.GetLanguageBlockManager(htmlBuffers.First());
            }
        }
示例#3
0
        internal JScriptBraceMatchingTagger(ITextView view, ITextBuffer sourceBuffer, IClassifier classifier)
        {
            _view             = view;
            _sourceBuffer     = sourceBuffer;
            _currentCharPoint = null;
            _classifier       = classifier;

            _view.TextBuffer.Changed    += TextBuffer_Changed;
            _view.Caret.PositionChanged += Caret_PositionChanged;

            if (sourceBuffer.ContentType.TypeName.Equals("HTML", StringComparison.OrdinalIgnoreCase))
            {
                _lbm = VsServiceManager.GetLanguageBlockManager(_sourceBuffer);
            }
        }
示例#4
0
        public OutliningTagger(ITextBuffer buffer, IClassifier classifier)
        {
            _buffer     = buffer;
            _classifier = classifier;
            _sections   = new List <ITrackingSpan>();

            if (buffer.ContentType.TypeName.Equals("HTML", StringComparison.OrdinalIgnoreCase))
            {
                _lbm = VsServiceManager.GetLanguageBlockManager(buffer);
            }

            _timer          = new DispatcherTimer(DispatcherPriority.ApplicationIdle);
            _timer.Interval = TimeSpan.FromMilliseconds(3000); // We'll force a reparse after 3 secs of no buffer changes
            _timer.Tick    += (sender, args) =>
            {
                Debug.WriteLine("OutliningTagger: _timer.Tick fired");
                _timer.Stop();
                ReparseFile();
            };
            buffer.Changed += BufferChanged;
            ReparseFile(); // Force an initial full parse
            _timer.Start();
        }