/// <summary> /// Retrieves (or creates) the validator (syntax checker) /// for the document that is associated with the text buffer /// </summary> /// <param name="textBuffer">Text buffer</param> public static TreeValidator EnsureFromTextBuffer(ITextBuffer textBuffer, IEditorTree editorTree) { TreeValidator validator = ServiceManager.GetService <TreeValidator>(textBuffer); if (validator == null) { validator = new TreeValidator(editorTree); } return(validator); }
public REditorDocument(ITextBuffer textBuffer) { EditorShell.Current.CompositionService.SatisfyImportsOnce(this); this.TextBuffer = textBuffer; IsClosed = false; TextDocumentFactoryService.TextDocumentDisposed += OnTextDocumentDisposed; ServiceManager.AddService<REditorDocument>(this, TextBuffer); _editorTree = new EditorTree(textBuffer); if (REditorSettings.SyntaxCheckInRepl) { _validator = new TreeValidator(this.EditorTree); } _editorTree.Build(); RCompletionEngine.Initialize(); }
/// <summary> /// Retrieves (or creates) the validator (syntax checker) /// for the document that is associated with the text buffer /// </summary> /// <param name="textBuffer">Text buffer</param> public static TreeValidator EnsureFromTextBuffer(ITextBuffer textBuffer, IEditorTree editorTree) { TreeValidator validator = ServiceManager.GetService<TreeValidator>(textBuffer); if (validator == null) { validator = new TreeValidator(editorTree); } return validator; }
public REditorDocument(ITextBuffer textBuffer, ICoreShell shell) { _shell = shell; _textDocumentFactoryService = _shell.ExportProvider.GetExportedValue<ITextDocumentFactoryService>(); _textDocumentFactoryService.TextDocumentDisposed += OnTextDocumentDisposed; TextBuffer = textBuffer; IsClosed = false; ServiceManager.AddService(this, TextBuffer, shell); var clh = ServiceManager.GetService<IContainedLanguageHost>(textBuffer); _editorTree = new EditorTree(textBuffer, shell, new ExpressionTermFilter(clh)); if (REditorSettings.SyntaxCheckInRepl) { _validator = new TreeValidator(EditorTree, shell); } _editorTree.Build(); }