public void UnRegisterLanguageService() { ShutdownBackgroundWorkers(); UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(ProjectFile.Location); } if (unsavedFile != null) { lock (UnsavedFiles) { UnsavedFiles.Remove(unsavedFile); } } if (LanguageService != null && ProjectFile != null) { LanguageService.UnregisterSourceFile(Editor, ProjectFile); } TextDocument.TextChanged -= TextDocument_TextChanged; }
public void Save() { if (SourceFile != null && Document != null && IsDirty) { try { FormatAll(); } catch (Exception) { } if (Settings.GetSettings <EditorSettings>().RemoveTrailingWhitespaceOnSave) { Document.TrimTrailingWhiteSpace(); } File.WriteAllText(SourceFile.Location, Document.Text); IsDirty = false; lock (UnsavedFiles) { var unsavedFile = UnsavedFiles.BinarySearch(SourceFile.Location); if (unsavedFile != null) { UnsavedFiles.Remove(unsavedFile); } } } }
private void UnRegisterLanguageService() { _languageServiceDisposables?.Dispose(); if (_scopeLineBackgroundRenderer != null) { TextArea.TextView.BackgroundRenderers.Remove(_scopeLineBackgroundRenderer); } if (_textColorizer != null) { TextArea.TextView.LineTransformers.Remove(_textColorizer); _textColorizer = null; } if (_diagnosticMarkersRenderer != null) { TextArea.TextView.BackgroundRenderers.Remove(_diagnosticMarkersRenderer); _diagnosticMarkersRenderer = null; } ShutdownBackgroundWorkers(); UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(SourceFile.Location); } if (unsavedFile != null) { lock (UnsavedFiles) { UnsavedFiles.Remove(unsavedFile); } } if (LanguageService != null) { LanguageService.UnregisterSourceFile(DocumentAccessor); } Document.TextChanged -= TextDocument_TextChanged; TextArea.TextEntering -= TextArea_TextEntering; TextArea.TextEntered -= TextArea_TextEntered; _intellisenseManager = null; }
public void Save() { if (ProjectFile != null && TextDocument != null && IsDirty) { System.IO.File.WriteAllText(ProjectFile.Location, TextDocument.Text); IsDirty = false; lock (UnsavedFiles) { var unsavedFile = UnsavedFiles.BinarySearch(ProjectFile.Location); if (unsavedFile != null) { UnsavedFiles.Remove(unsavedFile); } } } }
public void UnRegisterLanguageService() { if (_scopeLineBackgroundRenderer != null) { TextArea.TextView.BackgroundRenderers.Remove(_scopeLineBackgroundRenderer); } if (_textColorizer != null) { TextArea.TextView.LineTransformers.Remove(_textColorizer); _textColorizer = null; } if (_diagnosticMarkersRenderer != null) { TextArea.TextView.BackgroundRenderers.Remove(_diagnosticMarkersRenderer); _diagnosticMarkersRenderer = null; } ShutdownBackgroundWorkers(); UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(SourceFile.Location); } if (unsavedFile != null) { lock (UnsavedFiles) { UnsavedFiles.Remove(unsavedFile); } } if (LanguageService != null) { LanguageService.UnregisterSourceFile(this, SourceFile); } Document.TextChanged -= TextDocument_TextChanged; }
public void UnRegisterLanguageService() { foreach (var backgroundRenderer in _languageServiceBackgroundRenderers) { TextArea.TextView.BackgroundRenderers.Remove(backgroundRenderer); } _languageServiceBackgroundRenderers.Clear(); foreach (var transformer in _languageServiceDocumentLineTransformers) { TextArea.TextView.LineTransformers.Remove(transformer); } _languageServiceDocumentLineTransformers.Clear(); ShutdownBackgroundWorkers(); UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(SourceFile.Location); } if (unsavedFile != null) { lock (UnsavedFiles) { UnsavedFiles.Remove(unsavedFile); } } if (LanguageService != null) { LanguageService.UnregisterSourceFile(this, SourceFile); } Document.TextChanged -= TextDocument_TextChanged; }