public TreeValidator(IREditorTree editorTree, IServiceContainer services) { #if DEBUG TraceValidation.Enabled = false; #endif _editorTree = editorTree; _editorTree.UpdateCompleted += OnTreeUpdateCompleted; _editorTree.Closing += OnTreeClose; _settings = services.GetService <IREditorSettings>(); _idleTime = services.GetService <IIdleTimeService>(); // Advise to settings changed *after* accessing the RSettings, // since accessing the host application (VS) settings object may // cause it fire Changed notification in some cases. _settings.SettingsChanged += OnSettingsChanged; // _syntaxCheckEnabled = IsSyntaxCheckEnabled(_editorTree.EditorBuffer, _settings, out _lintCheckEnabled); // We don't want to start validation right away since it may // interfere with the editor perceived startup performance. StartValidationNextIdle(); ValidationResults = new ConcurrentQueue <IValidationError>(); editorTree.EditorBuffer.AddService(this); _aggregator = new ValidatorAggregator(services); }