Example #1
0
        public EditorErrorTagger(ITextBuffer textBuffer, IEditorTaskList taskList, IServiceContainer services)
        {
            _taskList = taskList;

            _settings = services.GetService <IREditorSettings>();
            _idleTime = services.GetService <IIdleTimeService>();

            _document          = textBuffer.GetEditorDocument <IREditorDocument>();
            _document.Closing += OnDocumentClosing;
            _document.EditorTree.UpdateCompleted += OnTreeUpdateCompleted;
            _document.EditorTree.NodesRemoved    += OnNodesRemoved;
            _errorTags = new ErrorTagCollection(_document.EditorTree);

            _textBuffer          = _document.EditorTree.TextBuffer();
            _textBuffer.Changed += OnTextBufferChanged;

            // Don't push syntax errors to the Error List in transient
            // documents such as in document attached to a projected buffer
            // in the R interactive window
            if (_taskList != null && !_document.IsRepl)
            {
                _taskList.AddTaskSource(this);
            }

            var validator = _document.EditorBuffer.GetService <TreeValidator>();

            validator.Cleared += OnCleared;

            _resultsQueue   = validator.ValidationResults;
            _idleTime.Idle += OnIdle;
        }
Example #2
0
        public EditorErrorTagger(ITextBuffer textBuffer, IEditorTaskList taskList, ICoreShell shell)
        {
            _taskList = taskList;
            _shell    = shell;
            _settings = _shell.GetService <IREditorSettings>();

            _document = REditorDocument.FromTextBuffer(textBuffer);
            _document.DocumentClosing            += OnDocumentClosing;
            _document.EditorTree.UpdateCompleted += OnTreeUpdateCompleted;
            _document.EditorTree.NodesRemoved    += OnNodesRemoved;
            _errorTags = new ErrorTagCollection(_document.EditorTree);

            _textBuffer          = _document.EditorTree.TextBuffer;
            _textBuffer.Changed += OnTextBufferChanged;

            _fireCodeMarkerUponCompletion = true;

            // Don't push syntax errors to the Error List in transient
            // documents such as in document attached to a projected buffer
            // in the R interactive window
            if (_taskList != null)
            {
                var view = _document.GetFirstView();
                if (view != null && !view.IsRepl())
                {
                    _taskList.AddTaskSource(this);
                }
            }

            TreeValidator validator = TreeValidator.EnsureFromTextBuffer(_textBuffer, _document.EditorTree, shell);

            validator.Cleared += OnCleared;
            ResultsQueue       = validator.ValidationResults;
            _shell.Idle       += OnIdle;
        }
Example #3
0
 public EditorErrorTaggerProvider(ICoreShell shell, [Import(AllowDefault = true)] IEditorTaskList taskList)
 {
     _shell    = shell;
     _taskList = taskList;
 }
Example #4
0
        internal static void StaticFlushTaskList()
        {
            IEditorTaskList tasks = ComponentLocator <IEditorTaskList> .Import();

            tasks.FlushTaskList();
        }
Example #5
0
        internal static void StaticFlushTaskList()
        {
            IEditorTaskList tasks = ComponentLocator <IEditorTaskList> .Import(VsAppShell.Current.CompositionService);

            tasks.FlushTaskList();
        }