diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-03-11 01:52:11 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-03-11 01:52:11 +0400 |
commit | 847d26a6139591c6f3dcd94e46883b20a6d3c1d4 (patch) | |
tree | 1be3b6a5f7fe53944c1a5ca0ff0531dfb9dbcb0b | |
parent | 2d89c7e3ad3988d0e9d36bd6e314428b5717c57a (diff) |
[TextEditor] Changed 'Document' to 'TextDocument' to prevent name
clashes with MonoDevelop.Ide.Gui.Document
75 files changed, 213 insertions, 397 deletions
diff --git a/extras/MonoDevelop.Database/MonoDevelop.Database.Query/SqlQueryView.cs b/extras/MonoDevelop.Database/MonoDevelop.Database.Query/SqlQueryView.cs index 398c303c9c..6dbed8d803 100644 --- a/extras/MonoDevelop.Database/MonoDevelop.Database.Query/SqlQueryView.cs +++ b/extras/MonoDevelop.Database/MonoDevelop.Database.Query/SqlQueryView.cs @@ -347,7 +347,7 @@ namespace MonoDevelop.Database.Query buttonExecute.Sensitive = QueryText.Length > 0; } - private void SqlChanged (object sender, Mono.TextEditor.ReplaceEventArgs args) + private void SqlChanged (object sender, Mono.TextEditor.DocumentChangeEventArgs args) { buttonExecute.Sensitive = QueryText.Length > 0; } diff --git a/extras/ValaBinding/Gui/ValaTextEditorExtension.cs b/extras/ValaBinding/Gui/ValaTextEditorExtension.cs index 058c043e93..39a1525500 100644 --- a/extras/ValaBinding/Gui/ValaTextEditorExtension.cs +++ b/extras/ValaBinding/Gui/ValaTextEditorExtension.cs @@ -346,7 +346,7 @@ namespace MonoDevelop.ValaBinding #endregion // Yoinked from C# binding - void UpdatePath (object sender, Mono.TextEditor.DocumentLocationEventArgs e) + void UpdatePath (object sender, Mono.TextEditor.TextDocumentLocationEventArgs e) { var unit = Document.CompilationUnit; if (unit == null) diff --git a/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs b/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs index 6bfad7a24b..fa8b3e50a9 100644 --- a/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs +++ b/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs @@ -47,7 +47,7 @@ namespace MonoDevelop.CSharp.Refactoring IncludeDocumentation = true; } - IEnumerable<DomRegion> SearchMember (IEntity member, ITypeResolveContext dom, FilePath fileName, Mono.TextEditor.TextEditorData editor, Mono.TextEditor.Document buildDocument, List<LocalDocumentInfo.OffsetInfo> offsetInfos, ParsedDocument parsedDocument) + IEnumerable<DomRegion> SearchMember (IEntity member, ITypeResolveContext dom, FilePath fileName, Mono.TextEditor.TextEditorData editor, Mono.TextEditor.TextDocument buildDocument, List<LocalDocumentInfo.OffsetInfo> offsetInfos, ParsedDocument parsedDocument) { // TODO: Type system conversion. yield break; // var resolver = new NRefactoryResolver (dom, parsedDocument.CompilationUnit, ICSharpCode.OldNRefactory.SupportedLanguage.CSharp, editor, fileName); @@ -87,7 +87,7 @@ namespace MonoDevelop.CSharp.Refactoring // var builder = new AspLanguageBuilder (); // // -// var buildDocument = new Mono.TextEditor.Document (); +// var buildDocument = new Mono.TextEditor.TextDocument (); // var offsetInfos = new List<LocalDocumentInfo.OffsetInfo> (); // buildDocument.Text = builder.BuildDocumentString (documentInfo, editor, offsetInfos, true); // var parsedDocument = AspLanguageBuilder.Parse (dom, fileName, buildDocument.Text); diff --git a/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs b/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs index 111f0f9bb7..3f2ad607af 100644 --- a/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs +++ b/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs @@ -155,7 +155,7 @@ namespace MonoDevelop.CSharp.Completion CSharpCompletionTextEditorExtension CreateCompletion (MonoDevelop.Ide.Gui.Document realDocument, DocumentInfo info, LocalDocumentInfo localInfo, out CodeCompletionContext codeCompletionContext) { - var doc = new Mono.TextEditor.Document () { + var doc = new Mono.TextEditor.TextDocument () { Text = localInfo.LocalDocument, }; var documentLocation = doc.OffsetToLocation (localInfo.CaretPosition); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs index e6ae57962a..383eaa38f8 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs @@ -113,7 +113,7 @@ namespace MonoDevelop.CodeGeneration static string AddIndent (string text, string indent) { - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = text; StringBuilder result = new StringBuilder (); foreach (var line in doc.Lines) { diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ContextAction/Actions/MoveTypeToFile.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ContextAction/Actions/MoveTypeToFile.cs index a4d7c9194a..c822586be4 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ContextAction/Actions/MoveTypeToFile.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ContextAction/Actions/MoveTypeToFile.cs @@ -98,7 +98,7 @@ namespace MonoDevelop.CSharp.ContextAction MonoDevelop.Ide.IdeApp.ProjectOperations.Save (context.Document.Project); } - static bool IsBlankLine (Document doc, int i) + static bool IsBlankLine (TextDocument doc, int i) { var line = doc.GetLine (i); return line.EditableLength == line.GetIndentation (doc).Length; @@ -106,7 +106,7 @@ namespace MonoDevelop.CSharp.ContextAction static string StripDoubleBlankLines (string content) { - var doc = new Mono.TextEditor.Document (content); + var doc = new Mono.TextEditor.TextDocument (content); for (int i = 1; i + 1 <= doc.LineCount; i++) { if (IsBlankLine (doc, i) && IsBlankLine (doc, i + 1)) { ((IBuffer)doc).Remove (doc.GetLine (i)); @@ -119,7 +119,7 @@ namespace MonoDevelop.CSharp.ContextAction static string StripHeader (string content) { - var doc = new Mono.TextEditor.Document (content); + var doc = new Mono.TextEditor.TextDocument (content); while (true) { string lineText = doc.GetLineText (1); if (lineText == null) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs index 29b37b137d..a4bcd291a4 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs @@ -562,7 +562,7 @@ namespace MonoDevelop.CSharp.Highlighting HashSet<string> symbols = new HashSet<string> (); - MonoDevelop.Projects.Project GetProject (Mono.TextEditor.Document doc) + MonoDevelop.Projects.Project GetProject (Mono.TextEditor.TextDocument doc) { // There is no reference between document & higher level infrastructure, // therefore it's a bit tricky to find the right project. @@ -584,7 +584,7 @@ namespace MonoDevelop.CSharp.Highlighting return project; } - public ConditinalExpressionEvaluator (Mono.TextEditor.Document doc) + public ConditinalExpressionEvaluator (Mono.TextEditor.TextDocument doc) { var project = GetProject (doc); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethod/ExtractMethodRefactoring.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethod/ExtractMethodRefactoring.cs index 8f612fb4e4..e76ec6b871 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethod/ExtractMethodRefactoring.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethod/ExtractMethodRefactoring.cs @@ -213,7 +213,7 @@ namespace MonoDevelop.CSharp.Refactoring.ExtractMethod static string GetIndent (string text) { - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = text; string result = null; for (int i = 1; i < doc.LineCount; i++) { @@ -228,7 +228,7 @@ namespace MonoDevelop.CSharp.Refactoring.ExtractMethod static string RemoveIndent (string text, string indent) { - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = text; StringBuilder result = new StringBuilder (); bool firstLine = true; @@ -245,7 +245,7 @@ namespace MonoDevelop.CSharp.Refactoring.ExtractMethod static string AddIndent (string text, string indent) { - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = text; StringBuilder result = new StringBuilder (); foreach (LineSegment line in doc.Lines) { diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs index ddd6d9ff5c..da54129ba1 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs @@ -116,7 +116,7 @@ namespace MonoDevelop.AssemblyBrowser ShowTabs = false, HighlightCaretLine = true, }; - inspectEditor = new Mono.TextEditor.TextEditor (new Mono.TextEditor.Document (), options); + inspectEditor = new Mono.TextEditor.TextEditor (new Mono.TextEditor.TextDocument (), options); inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent; this.inspectEditor.Document.ReadOnly = true; diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs index 44b9cb417f..c9ba335881 100755 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs @@ -51,13 +51,13 @@ namespace MonoDevelop.AssemblyBrowser public class ColoredCSharpFormatter : ICSharpCode.Decompiler.ITextOutput { public StringBuilder sb = new StringBuilder(); - Document doc; + TextDocument doc; bool write_indent; int indent; public List<FoldSegment> FoldSegments = new List<FoldSegment>(); public List<ReferenceSegment> ReferencedSegments = new List<ReferenceSegment>(); - public ColoredCSharpFormatter (Document doc) + public ColoredCSharpFormatter (TextDocument doc) { this.doc = doc; } diff --git a/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/ComplexityMetrics.cs b/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/ComplexityMetrics.cs index 984f33b9fc..87c0c52f7a 100644 --- a/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/ComplexityMetrics.cs +++ b/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/ComplexityMetrics.cs @@ -53,7 +53,7 @@ // internal static List<LineSegment> FileText // { get; private set; } // -// internal static Mono.TextEditor.Document FileDoc +// internal static Mono.TextEditor.TextDocument FileDoc // { get; private set; } // // internal static ProjectProperties ProjProp @@ -84,7 +84,7 @@ // } // ProjProp = project; // File = file; -// Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); +// Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); // doc.Text = text; // FileDoc = doc; // FileText = new List<LineSegment>(); diff --git a/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/LOCEvaluate.cs b/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/LOCEvaluate.cs index 224c7a284b..c69f109078 100644 --- a/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/LOCEvaluate.cs +++ b/main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics/LOCEvaluate.cs @@ -225,7 +225,7 @@ // return node.EndLocation.Line; // } // -// internal static void EvaluateMethodLOC(MethodProperties prop, List<LineSegment> text, Mono.TextEditor.Document doc) +// internal static void EvaluateMethodLOC(MethodProperties prop, List<LineSegment> text, Mono.TextEditor.TextDocument doc) // { // ulong totalLines = 0, totalRealLines = 0, totalCommentedLines = 0; // int realLines = 0; diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs index 2d52e319e4..c47914ef1e 100644 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs +++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs @@ -546,7 +546,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder static string StripHeaderAndBlankLines (string text, CodeDomProvider provider) { - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = text; int realStartLine = 0; for (int i = 1; i <= doc.LineCount; i++) { @@ -579,7 +579,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder return doc.GetTextAt (offset, doc.Length - offset); } - static void CheckLine (Mono.TextEditor.Document doc, Mono.TextEditor.LineSegment line, out bool isBlank, out bool isBracket) + static void CheckLine (Mono.TextEditor.TextDocument doc, Mono.TextEditor.LineSegment line, out bool isBlank, out bool isBracket) { isBlank = true; isBracket = false; diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs index 8a8c36dce1..4ea3f4c9ee 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs @@ -107,7 +107,7 @@ namespace MonoDevelop.Refactoring return; } - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = System.IO.File.ReadAllText (replaceChange.FileName); DocumentLocation loc = doc.OffsetToLocation (replaceChange.Offset); @@ -134,7 +134,7 @@ namespace MonoDevelop.Refactoring return; var openDocument = IdeApp.Workbench.GetDocument (replaceChange.FileName); - Mono.TextEditor.Document originalDocument = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument originalDocument = new Mono.TextEditor.TextDocument (); originalDocument.FileName = replaceChange.FileName; if (openDocument == null) { originalDocument.Text = System.IO.File.ReadAllText (replaceChange.FileName); @@ -142,7 +142,7 @@ namespace MonoDevelop.Refactoring originalDocument.Text = openDocument.Editor.Document.Text; } - Mono.TextEditor.Document changedDocument = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument changedDocument = new Mono.TextEditor.TextDocument (); changedDocument.FileName = replaceChange.FileName; changedDocument.Text = originalDocument.Text; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs index a31642372f..5edb903966 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs @@ -92,9 +92,9 @@ namespace MonoDevelop.SourceEditor class FileContent { public string FileName; - public Mono.TextEditor.Document Content; + public Mono.TextEditor.TextDocument Content; - public FileContent (string fileName, Mono.TextEditor.Document content) + public FileContent (string fileName, Mono.TextEditor.TextDocument content) { this.FileName = fileName; this.Content = content; @@ -167,7 +167,7 @@ namespace MonoDevelop.SourceEditor } } - public static void InformAutoSaveThread (Mono.TextEditor.Document content) + public static void InformAutoSaveThread (Mono.TextEditor.TextDocument content) { if (content == null || !autoSaveEnabled) return; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs index a8843f24a5..5b3b14def9 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs @@ -64,7 +64,7 @@ namespace MonoDevelop.SourceEditor get { return (ISourceEditorOptions)base.Options; } } - public ExtensibleTextEditor (SourceEditorView view, ISourceEditorOptions options, Mono.TextEditor.Document doc) : base(doc, options) + public ExtensibleTextEditor (SourceEditorView view, ISourceEditorOptions options, Mono.TextEditor.TextDocument doc) : base(doc, options) { Initialize (view); } @@ -253,7 +253,7 @@ namespace MonoDevelop.SourceEditor } } - static IEnumerable<KeyValuePair <char, int>> GetTextWithoutCommentsAndStrings (Mono.TextEditor.Document doc, int start, int end) + static IEnumerable<KeyValuePair <char, int>> GetTextWithoutCommentsAndStrings (Mono.TextEditor.TextDocument doc, int start, int end) { bool isInString = false, isInChar = false; bool isInLineComment = false, isInBlockComment = false; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/QuickTaskStrip.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/QuickTaskStrip.cs index 63109f2748..bfe71ec894 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/QuickTaskStrip.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/QuickTaskStrip.cs @@ -612,7 +612,7 @@ namespace MonoDevelop.SourceEditor { Pixmap backgroundPixbuf, backgroundBuffer; uint redrawTimeout; - Document doc; + TextDocument doc; protected override double IndicatorHeight { get { return 16; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs index 6688329a07..6a349b1db6 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs @@ -33,11 +33,11 @@ namespace MonoDevelop.SourceEditor { class SourceEditorPrintOperation : PrintOperation { - Document doc; + TextDocument doc; FilePath filename; SourceEditorPrintSettings settings; - public SourceEditorPrintOperation (Document doc, FilePath filename) + public SourceEditorPrintOperation (TextDocument doc, FilePath filename) { this.doc = doc; this.filename = filename; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs index f6c06e1e0d..cf6f3f2c63 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs @@ -79,7 +79,7 @@ namespace MonoDevelop.SourceEditor bool writeAllowed; bool writeAccessChecked; - public Mono.TextEditor.Document Document { + public Mono.TextEditor.TextDocument Document { get { return widget.TextEditor.Document; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 89dea2202d..14231273ba 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -34,7 +34,7 @@ using MonoDevelop.Components.Commands; using MonoDevelop.Core; using MonoDevelop.Projects; using MonoDevelop.Ide.Commands; -using Document = Mono.TextEditor.Document; +using Document = Mono.TextEditor.TextDocument; using Services = MonoDevelop.Projects.Services; using System.Threading; using MonoDevelop.Ide; @@ -1341,7 +1341,7 @@ namespace MonoDevelop.SourceEditor } #endregion - public Mono.TextEditor.Document Document { + public Mono.TextEditor.TextDocument Document { get { var editor = TextEditor; if (editor == null) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs index d9705d1100..5fb50510e4 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs @@ -521,8 +521,8 @@ namespace MonoDevelop.VersionControl.Subversion {
List<Annotation> annotations = new List<Annotation> (Svn.GetAnnotations (this, localPath, SvnRevision.First, SvnRevision.Base));
Annotation nextRev = new Annotation (GettextCatalog.GetString ("working copy"), "", DateTime.MinValue);
- var baseDocument = new Mono.TextEditor.Document (File.ReadAllText (GetPathToBaseText (localPath)));
- var workingDocument = new Mono.TextEditor.Document (File.ReadAllText (localPath));
+ var baseDocument = new Mono.TextEditor.TextDocument (File.ReadAllText (GetPathToBaseText (localPath)));
+ var workingDocument = new Mono.TextEditor.TextDocument (File.ReadAllText (localPath));
// "SubversionException: blame of the WORKING revision is not supported"
foreach (var hunk in baseDocument.Diff (workingDocument)) {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index ecc20e86b5..27d518753f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -337,7 +337,7 @@ namespace MonoDevelop.VersionControl.Views sb.Append (ch); } - Document doc = new Document (); + var doc = new TextDocument (); doc.Text = sb.ToString (); for (int i = 1; i <= doc.LineCount; i++) { string text = doc.GetLineText (i).Trim (); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs index 5112875a88..3604f6bec6 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs @@ -74,8 +74,8 @@ namespace MonoDevelop.VersionControl.Views protected override void CreateComponents () { this.editors = new [] { - new TextEditor (new Mono.TextEditor.Document (), new CommonTextEditorOptions ()), - new TextEditor (new Mono.TextEditor.Document (), new CommonTextEditorOptions ()), + new TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ()), + new TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ()), }; if (!viewOnly) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs index f97e5bdc78..a1c32d5332 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs @@ -89,7 +89,7 @@ namespace MonoDevelop.VersionControl.Views }; comparisonWidget.SetVersionControlInfo (info); this.buttonDiff.Clicked += HandleButtonDiffhandleClicked; - diffTextEditor = new global::Mono.TextEditor.TextEditor (new Mono.TextEditor.Document (), new CommonTextEditorOptions ()); + diffTextEditor = new global::Mono.TextEditor.TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ()); diffTextEditor.Document.MimeType = "text/x-diff"; diffTextEditor.Options.ShowFoldMargin = false; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs index 6e739875a6..4ddcc1ea57 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs @@ -574,7 +574,7 @@ namespace MonoDevelop.VersionControl.Views } } - Dictionary<Mono.TextEditor.Document, TextEditorData> dict = new Dictionary<Mono.TextEditor.Document, TextEditorData> (); + Dictionary<Mono.TextEditor.TextDocument, TextEditorData> dict = new Dictionary<Mono.TextEditor.TextDocument, TextEditorData> (); List<TextEditorData> localUpdate = new List<TextEditorData> (); @@ -616,7 +616,7 @@ namespace MonoDevelop.VersionControl.Views void HandleDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e) { - var data = dict [(Document)sender]; + var data = dict [(TextDocument)sender]; localUpdate.Remove (data); var editor = info.Document.GetContent<IEditableTextFile> (); editor.DeleteText (e.Offset, e.RemovalLength); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index 281698aa98..0c055fd0cc 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -338,7 +338,7 @@ namespace MonoDevelop.VersionControl.Views return; } string[] lines; - var changedDocument = new Mono.TextEditor.Document (text); + var changedDocument = new Mono.TextEditor.TextDocument (text); if (prevRev == null) { lines = new string[changedDocument.LineCount]; for (int i = 0; i < changedDocument.LineCount; i++) { @@ -353,7 +353,7 @@ namespace MonoDevelop.VersionControl.Views // The file did not exist at this point in time, so just treat it as empty } - var originalDocument = new Mono.TextEditor.Document (prevRevisionText); + var originalDocument = new Mono.TextEditor.TextDocument (prevRevisionText); originalDocument.FileName = "Revision " + prevRev.ToString (); changedDocument.FileName = "Revision " + rev.ToString (); lines = Mono.TextEditor.Utils.Diff.GetDiffString (originalDocument, changedDocument).Split ('\n'); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs index 8a43ab04a4..fc73d51fd9 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs @@ -108,9 +108,9 @@ namespace MonoDevelop.VersionControl.Views protected override void CreateComponents () { this.editors = new [] { - new TextEditor (new Mono.TextEditor.Document (), new CommonTextEditorOptions ()), - new TextEditor (new Mono.TextEditor.Document (), new CommonTextEditorOptions ()), - new TextEditor (new Mono.TextEditor.Document (), new CommonTextEditorOptions ()), + new TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ()), + new TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ()), + new TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ()), }; this.editors[0].Document.ReadOnly = true; @@ -124,7 +124,7 @@ namespace MonoDevelop.VersionControl.Views } // todo: move to version control backend - IEnumerable<Conflict> Conflicts (Mono.TextEditor.Document doc) + IEnumerable<Conflict> Conflicts (Mono.TextEditor.TextDocument doc) { foreach (int mergeStart in doc.SearchForward ("<<<<<<<", 0)) { LineSegment start = doc.GetLineByOffset (mergeStart); @@ -249,7 +249,7 @@ namespace MonoDevelop.VersionControl.Views void UpdateConflictsOnTextReplace (object sender, DocumentChangeEventArgs e) { this.UpdateDiff (); - Mono.TextEditor.Document.UpdateSegments (GetAllConflictingSegments (), e); + Mono.TextEditor.TextDocument.UpdateSegments (GetAllConflictingSegments (), e); } } }
\ No newline at end of file diff --git a/main/src/core/Mono.Texteditor/Makefile.am b/main/src/core/Mono.Texteditor/Makefile.am index 7e4bc036bf..502af22618 100644 --- a/main/src/core/Mono.Texteditor/Makefile.am +++ b/main/src/core/Mono.Texteditor/Makefile.am @@ -103,7 +103,6 @@ FILES = \ Mono.TextEditor/IBracketMatcher.cs \ Mono.TextEditor/IBuffer.cs \ Mono.TextEditor/IconMargin.cs \ - Mono.TextEditor/IDocumentPartitioner.cs \ Mono.TextEditor/IIndentationTracker.cs \ Mono.TextEditor/ILineSplitter.cs \ Mono.TextEditor/IndentStyle.cs \ diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Chunk.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Chunk.cs index 967f78a6d7..518a2e32b8 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Chunk.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Chunk.cs @@ -67,11 +67,12 @@ namespace Mono.TextEditor } - public virtual string GetText (Document doc) + public virtual string GetText (TextDocument doc) { return doc.GetTextAt (this); } - public virtual char GetCharAt (Document doc, int offset) + + public virtual char GetCharAt (TextDocument doc, int offset) { return doc.GetCharAt (offset); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/JaySyntaxMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/JaySyntaxMode.cs index 3e9fa073c6..d15ff608c4 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/JaySyntaxMode.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/JaySyntaxMode.cs @@ -34,7 +34,7 @@ namespace Mono.TextEditor.Highlighting { public class JaySyntaxMode : Mono.TextEditor.Highlighting.SyntaxMode { - public JaySyntaxMode (Document doc) : base (doc) + public JaySyntaxMode (TextDocument doc) : base (doc) { ResourceXmlProvider provider = new ResourceXmlProvider (typeof(IXmlProvider).Assembly, typeof(IXmlProvider).Assembly.GetManifestResourceNames ().First (s => s.Contains ("JaySyntaxMode"))); using (XmlReader reader = provider.Open ()) { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Rule.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Rule.cs index 2c95240d19..a9f6ec41b3 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Rule.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/Rule.cs @@ -139,7 +139,7 @@ namespace Mono.TextEditor.Highlighting this.mode = mode; } - public virtual Rule GetRule (Document doc, string name) + public virtual Rule GetRule (TextDocument doc, string name) { return mode.GetRule (doc, name); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs index 9616a42f29..dd5f58de7a 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs @@ -35,7 +35,7 @@ namespace Mono.TextEditor { public abstract class SemanticRule { - public abstract void Analyze (Document doc, LineSegment line, Chunk startChunk, int startOffset, int endOffset); + public abstract void Analyze (TextDocument doc, LineSegment line, Chunk startChunk, int startOffset, int endOffset); } public class HighlightUrlSemanticRule : SemanticRule @@ -52,7 +52,7 @@ namespace Mono.TextEditor } bool inUpdate = false; - public override void Analyze (Document doc, LineSegment line, Chunk startChunk, int startOffset, int endOffset) + public override void Analyze (TextDocument doc, LineSegment line, Chunk startChunk, int startOffset, int endOffset) { if (endOffset <= startOffset || startOffset >= doc.Length || inUpdate) return; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs index 7f84041d9f..f9ada08b50 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs @@ -37,9 +37,9 @@ namespace Mono.TextEditor.Highlighting { public class SyntaxMode : Rule { - protected Document doc; + protected TextDocument doc; - public Document Document { + public TextDocument Document { get { return doc; } @@ -79,7 +79,7 @@ namespace Mono.TextEditor.Highlighting this.Delimiter = "&()<>{}[]~!%^*-+=|\\#/:;\"' ,\t.?"; } - public SyntaxMode (Document doc) : this () + public SyntaxMode (TextDocument doc) : this () { this.doc = doc; } @@ -226,7 +226,7 @@ namespace Mono.TextEditor.Highlighting return result.ToString (); } - public static int GetIndentLength (Document doc, int offset, int length, bool skipFirstLine) + public static int GetIndentLength (TextDocument doc, int offset, int length, bool skipFirstLine) { int curOffset = offset; int indentLength = int.MaxValue; @@ -257,7 +257,7 @@ namespace Mono.TextEditor.Highlighting protected SyntaxMode mode; protected CloneableStack<Span> spanStack; protected Stack<Rule> ruleStack; - protected Document doc; + protected TextDocument doc; int maxEnd; public Rule CurRule { @@ -495,7 +495,7 @@ namespace Mono.TextEditor.Highlighting { readonly string defaultStyle = "text"; protected SpanParser spanParser; - protected Document doc; + protected TextDocument doc; protected LineSegment line; internal int lineOffset; protected SyntaxMode mode; @@ -698,7 +698,7 @@ namespace Mono.TextEditor.Highlighting } } - public override Rule GetRule (Document doc, string name) + public override Rule GetRule (TextDocument doc, string name) { if (name == null || name == "<root>") { return this; @@ -793,7 +793,7 @@ namespace Mono.TextEditor.Highlighting public interface ISyntaxModeProvider { - SyntaxMode Create (Document doc); + SyntaxMode Create (TextDocument doc); } public class ProtoTypeSyntaxModeProvider : ISyntaxModeProvider @@ -805,7 +805,7 @@ namespace Mono.TextEditor.Highlighting this.prototype = prototype; } - SyntaxMode DeepCopy (Document doc, SyntaxMode mode) + SyntaxMode DeepCopy (TextDocument doc, SyntaxMode mode) { var newMode = new SyntaxMode (doc); @@ -833,7 +833,7 @@ namespace Mono.TextEditor.Highlighting return newMode; } - Rule DeepCopy (Document doc, SyntaxMode mode, Rule rule) + Rule DeepCopy (TextDocument doc, SyntaxMode mode, Rule rule) { Rule newRule = new Rule (mode); newRule.spans = new Span[rule.Spans.Length]; @@ -854,7 +854,7 @@ namespace Mono.TextEditor.Highlighting return newRule; } - public SyntaxMode Create (Document doc) + public SyntaxMode Create (TextDocument doc) { return DeepCopy (doc, prototype); } @@ -862,14 +862,14 @@ namespace Mono.TextEditor.Highlighting public class SyntaxModeProvider : ISyntaxModeProvider { - Func<Document, SyntaxMode> createFunction; + Func<TextDocument, SyntaxMode> createFunction; - public SyntaxModeProvider (Func<Document, SyntaxMode> createFunction) + public SyntaxModeProvider (Func<TextDocument, SyntaxMode> createFunction) { this.createFunction = createFunction; } - public SyntaxMode Create (Document doc) + public SyntaxMode Create (TextDocument doc) { return createFunction (doc); } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs index e40a0de13f..699f8ab047 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs @@ -133,12 +133,12 @@ namespace Mono.TextEditor.Highlighting } } - public static SyntaxMode GetSyntaxMode (Document doc) + public static SyntaxMode GetSyntaxMode (TextDocument doc) { return GetSyntaxMode (doc, doc.MimeType); } - public static SyntaxMode GetSyntaxMode (Document doc, string mimeType) + public static SyntaxMode GetSyntaxMode (TextDocument doc, string mimeType) { SyntaxMode result = null; if (syntaxModes.ContainsKey (mimeType)) { @@ -158,7 +158,7 @@ namespace Mono.TextEditor.Highlighting public static bool ValidateAllSyntaxModes () { - Document doc = new Document (); + var doc = new TextDocument (); foreach (string mime in new List<string> (syntaxModeLookup.Keys)) { GetSyntaxMode (doc, mime); } @@ -201,7 +201,7 @@ namespace Mono.TextEditor.Highlighting } } - public static void ScanSpans (Document doc, SyntaxMode mode, Rule rule, CloneableStack<Span> spanStack, int start, int end) + public static void ScanSpans (TextDocument doc, SyntaxMode mode, Rule rule, CloneableStack<Span> spanStack, int start, int end) { SyntaxMode.SpanParser parser = mode.CreateSpanParser (null, spanStack); parser.ParseSpans (start, end - start); @@ -211,7 +211,7 @@ namespace Mono.TextEditor.Highlighting class UpdateWorker { - Document doc; + TextDocument doc; SyntaxMode mode; int startOffset; int endOffset; @@ -221,7 +221,7 @@ namespace Mono.TextEditor.Highlighting private set; } - public Document Doc { + public TextDocument Doc { get { return this.doc; } } @@ -229,7 +229,7 @@ namespace Mono.TextEditor.Highlighting get; set; } - public UpdateWorker (Document doc, SyntaxMode mode, int startOffset, int endOffset) + public UpdateWorker (TextDocument doc, SyntaxMode mode, int startOffset, int endOffset) { this.doc = doc; this.mode = mode; @@ -324,7 +324,7 @@ namespace Mono.TextEditor.Highlighting } } - public static void StartUpdate (Document doc, SyntaxMode mode, int startOffset, int endOffset) + public static void StartUpdate (TextDocument doc, SyntaxMode mode, int startOffset, int endOffset) { lock (updateQueue) { updateQueue.Enqueue (new UpdateWorker (doc, mode, startOffset, endOffset)); @@ -332,7 +332,7 @@ namespace Mono.TextEditor.Highlighting queueSignal.Set (); } - public static void WaitUpdate (Document doc) + public static void WaitUpdate (TextDocument doc) { UpdateWorker[] arr; lock (updateQueue) { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs index 6c3043162c..808ae1ebe9 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs @@ -426,12 +426,12 @@ namespace Mono.TextEditor.Utils // LCS() - public static string GetDiffString (Document baseDocument, Document changedDocument) + public static string GetDiffString (TextDocument baseDocument, TextDocument changedDocument) { return GetDiffString (baseDocument.Diff (changedDocument), baseDocument, changedDocument, baseDocument.FileName, changedDocument.FileName); } - public static string GetDiffString (IEnumerable<Hunk> diff, Document baseDocument, Document changedDocument, string baseFileName, string changedFileName) + public static string GetDiffString (IEnumerable<Hunk> diff, TextDocument baseDocument, TextDocument changedDocument, string baseFileName, string changedFileName) { if (diff == null) return ""; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs index 5e9b35921a..ca6b9afc15 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs @@ -71,7 +71,7 @@ namespace Mono.TextEditor.Utils /// <param name='lineCount'> /// The number of lines to get words from /// </param> - public static List<ISegment> BreakLinesIntoWords (Document document, int startLine, int lineCount, bool includeDelimiter = true) + public static List<ISegment> BreakLinesIntoWords (TextDocument document, int startLine, int lineCount, bool includeDelimiter = true) { var result = new List<ISegment> (); for (int line = startLine; line < startLine + lineCount; line++) { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs index 721a6cf504..4deb30e9d3 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs @@ -57,7 +57,7 @@ namespace Mono.TextEditor.Vi public TextEditor Editor { get { return editMode.Editor; } } public TextEditorData Data { get { return editMode.Data; } } - public Document Document { get { return Data.Document; } } + public TextDocument Document { get { return Data.Document; } } ViBuilderContext Context { get; set; } public string Message { get; private set; } public ViEditorMode Mode { get; private set; } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs index 9f8b9cdf01..3924d5c7ab 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs @@ -39,7 +39,7 @@ namespace Mono.TextEditor.Vi /// <summary> /// Move to next non-whitespace change in character class. /// </summary> - public override int FindNextSubwordOffset (Document doc, int offset) + public override int FindNextSubwordOffset (TextDocument doc, int offset) { int myoffset = offset; if (0 > myoffset || doc.Length-1 <= myoffset){ return myoffset; } @@ -60,7 +60,7 @@ namespace Mono.TextEditor.Vi /// <summary> /// Move past next whitespace group. /// </summary> - public override int FindNextWordOffset (Document doc, int offset) + public override int FindNextWordOffset (TextDocument doc, int offset) { int myoffset = offset; if (0 > myoffset || doc.Length-1 <= myoffset){ return myoffset; } @@ -78,7 +78,7 @@ namespace Mono.TextEditor.Vi /// <summary> /// Move to previous non-whitespace change in character class. /// </summary> - public override int FindPrevSubwordOffset (Document doc, int offset) + public override int FindPrevSubwordOffset (TextDocument doc, int offset) { int myoffset = offset-1; char c; @@ -100,7 +100,7 @@ namespace Mono.TextEditor.Vi /// <summary> /// Move to end of previous whitespace group. /// </summary> - public override int FindPrevWordOffset (Document doc, int offset) + public override int FindPrevWordOffset (TextDocument doc, int offset) { --offset; if (0 > offset || doc.Length-1 <= offset){ return offset; } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj index dfee072030..d23132db3d 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj @@ -160,7 +160,6 @@ <Compile Include="Mono.TextEditor.PopupWindow\ModeHelpWindow.cs" /> <Compile Include="Mono.TextEditor.Highlighting\CloneableStack.cs" /> <Compile Include="Mono.TextEditor.Utils\Diff.cs" /> - <Compile Include="Mono.TextEditor\IDocumentPartitioner.cs" /> <Compile Include="Mono.TextEditor\AbstractPartitioner.cs" /> <Compile Include="Mono.TextEditor\TypedSegment.cs" /> <Compile Include="Mono.TextEditor.Highlighting\HighlightingPartitioner.cs" /> diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkActions.cs index deafed7b7d..de1320674a 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkActions.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkActions.cs @@ -40,7 +40,7 @@ namespace Mono.TextEditor { public static class BookmarkActions { - static int GetNextOffset (Document document, int lineNumber) + static int GetNextOffset (TextDocument document, int lineNumber) { int startLineNumber = lineNumber + 1; if (startLineNumber > document.Length) @@ -58,7 +58,7 @@ namespace Mono.TextEditor data.Caret.Offset = offset; } - static int GetPrevOffset (Document document, int lineNumber) + static int GetPrevOffset (TextDocument document, int lineNumber) { int startLineNumber = lineNumber - 1; if (startLineNumber < 0) diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/CaretMoveActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/CaretMoveActions.cs index a3ff7d0c01..ef0d81468e 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/CaretMoveActions.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/CaretMoveActions.cs @@ -206,7 +206,7 @@ namespace Mono.TextEditor } } - static int GetHomeMark (Document document, LineSegment line) + static int GetHomeMark (TextDocument document, LineSegment line) { int result; for (result = 0; result < line.EditableLength; result++) diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/ClipboardActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/ClipboardActions.cs index 22e2684571..09e71273f5 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/ClipboardActions.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/ClipboardActions.cs @@ -121,13 +121,13 @@ namespace Mono.TextEditor // NOTHING ? } - public Document copiedDocument; - public Document monoDocument; // has a slightly different format !!! + public TextDocument copiedDocument; + public TextDocument monoDocument; // has a slightly different format !!! public Mono.TextEditor.Highlighting.ColorSheme docStyle; ITextEditorOptions options; Mono.TextEditor.Highlighting.SyntaxMode mode; - static string GenerateRtf (Document doc, Mono.TextEditor.Highlighting.SyntaxMode mode, Mono.TextEditor.Highlighting.ColorSheme style, ITextEditorOptions options) + static string GenerateRtf (TextDocument doc, Mono.TextEditor.Highlighting.SyntaxMode mode, Mono.TextEditor.Highlighting.ColorSheme style, ITextEditorOptions options) { StringBuilder rtfText = new StringBuilder (); List<Gdk.Color> colorList = new List<Gdk.Color> (); @@ -270,8 +270,8 @@ namespace Mono.TextEditor copiedDocument = null; monoDocument = null; if (selection != null && data != null && data.Document != null) { - copiedDocument = new Document (); - monoDocument = new Document (); + copiedDocument = new TextDocument (); + monoDocument = new TextDocument (); this.docStyle = data.ColorStyle; this.options = data.Options; this.mode = data.Document.SyntaxMode != null && data.Options.EnableSyntaxHighlighting ? data.Document.SyntaxMode : new SyntaxMode (data.Document); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs index e4a0b2d723..6e4f68542c 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs @@ -35,7 +35,7 @@ using System.ComponentModel; namespace Mono.TextEditor { - public class Document : AbstractAnnotatable, IBuffer, ICSharpCode.NRefactory.Editor.IDocument + public class TextDocument : AbstractAnnotatable, IBuffer, ICSharpCode.NRefactory.Editor.IDocument { IBuffer buffer; internal ILineSplitter splitter; @@ -87,7 +87,7 @@ namespace Mono.TextEditor set; } - protected Document (IBuffer buffer,ILineSplitter splitter) + protected TextDocument (IBuffer buffer,ILineSplitter splitter) { this.buffer = buffer; this.splitter = splitter; @@ -102,25 +102,25 @@ namespace Mono.TextEditor foldedSegments.Remove (e.Node); } - public Document () : this(new GapBuffer (), new LineSplitter ()) + public TextDocument () : this(new GapBuffer (), new LineSplitter ()) { } - public Document (string text) : this() + public TextDocument (string text) : this() { Text = text; } - public static Document CreateImmutableDocument (string text) + public static TextDocument CreateImmutableDocument (string text) { - return new Document(new StringBuffer(text), new PrimitiveLineSplitter()) { + return new TextDocument(new StringBuffer(text), new PrimitiveLineSplitter()) { SuppressHighlightUpdate = true, Text = text, ReadOnly = true }; } - ~Document () + ~TextDocument () { if (foldSegmentWorker != null) { foldSegmentWorker.Dispose (); @@ -204,8 +204,6 @@ namespace Mono.TextEditor // Debug.Assert (0 <= offset && offset + count <= Length); int oldLineCount = this.LineCount; var args = new DocumentChangeEventArgs (offset, count > 0 ? GetTextAt (offset, count) : "", value); - if (Partitioner != null) - Partitioner.TextReplacing (args); OnTextReplacing (args); value = args.InsertedText; /* insert/repla @@ -230,8 +228,6 @@ namespace Mono.TextEditor buffer.Replace (offset, count, value); foldSegmentTree.UpdateOnTextReplace (this, args); splitter.TextReplaced (this, args); - if (Partitioner != null) - Partitioner.TextReplaced (args); OnTextReplaced (args); UpdateUndoStackOnReplace (args); @@ -477,7 +473,7 @@ namespace Mono.TextEditor } - internal void Setup (Document doc, DocumentChangeEventArgs args) + internal void Setup (TextDocument doc, DocumentChangeEventArgs args) { if (args != null) { this.startOffset = args.Offset; @@ -494,7 +490,7 @@ namespace Mono.TextEditor } } - public virtual void Undo (Document doc) + public virtual void Undo (TextDocument doc) { if (args.InsertionLength > 0) ((IBuffer)doc).Remove (args.Offset, args.InsertionLength); @@ -503,7 +499,7 @@ namespace Mono.TextEditor OnUndoDone (); } - public virtual void Redo (Document doc) + public virtual void Redo (TextDocument doc) { ((IBuffer)doc).Replace (args.Offset, args.RemovalLength, args.InsertedText); OnRedoDone (); @@ -565,7 +561,7 @@ namespace Mono.TextEditor operations.Add (operation); } - public override void Undo (Document doc) + public override void Undo (TextDocument doc) { for (int i = operations.Count - 1; i >= 0; i--) { operations[i].Undo (doc); @@ -574,7 +570,7 @@ namespace Mono.TextEditor OnUndoDone (); } - public override void Redo (Document doc) + public override void Redo (TextDocument doc) { foreach (UndoOperation operation in this.operations) { operation.Redo (doc); @@ -810,9 +806,9 @@ namespace Mono.TextEditor class UndoGroup : IDisposable { - Document doc; + TextDocument doc; - public UndoGroup (Document doc) + public UndoGroup (TextDocument doc) { if (doc == null) throw new ArgumentNullException ("doc"); @@ -1554,7 +1550,7 @@ namespace Mono.TextEditor return result; } - public IEnumerable<Hunk> Diff (Document changedDocument, bool includeEol = true) + public IEnumerable<Hunk> Diff (TextDocument changedDocument, bool includeEol = true) { var codeDictionary = new Dictionary<string, int> (); int codeCounter = 0; @@ -1563,53 +1559,7 @@ namespace Mono.TextEditor } #endregion - #region Partitioner - IDocumentPartitioner partitioner; - public IDocumentPartitioner Partitioner { - get { - return partitioner; - } - set { - partitioner = value; - partitioner.Document = this; - } - } - - public IEnumerable<TypedSegment> GetPartitions (int offset, int length) - { - if (Partitioner == null) - return new TypedSegment[0]; - return Partitioner.GetPartitions (offset, length); - } - - public IEnumerable<TypedSegment> GetPartitions (ISegment segment) - { - if (Partitioner == null) - return new TypedSegment[0]; - return Partitioner.GetPartitions (segment); - } - - public TypedSegment GetPartition (int offset) - { - if (Partitioner == null) - return null; - return Partitioner.GetPartition (offset); - } - public TypedSegment GetPartition (DocumentLocation location) - { - if (Partitioner == null) - return null; - return Partitioner.GetPartition (location); - } - - public TypedSegment GetPartition (int line, int column) - { - if (Partitioner == null) - return null; - return Partitioner.GetPartition (line, column); - } - #endregion #region ContentLoaded // The problem: Action to perform on a newly opened text editor, but content didn't get loaded because autosave file exist. diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs index 988cf7bd1e..53b2c3ef13 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs @@ -87,7 +87,7 @@ namespace Mono.TextEditor } protected Caret Caret { get { return textEditorData.Caret; } } - protected Document Document { get { return textEditorData.Document; } } + protected TextDocument Document { get { return textEditorData.Document; } } protected TextEditor Editor { get { return editor; } } protected TextEditorData Data { get { return textEditorData; } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/EmacsWordFindStrategy.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/EmacsWordFindStrategy.cs index fcad20e7f4..5d23ba3dfe 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/EmacsWordFindStrategy.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/EmacsWordFindStrategy.cs @@ -41,7 +41,7 @@ namespace Mono.TextEditor this.treat_ = treat_;
}
- int FindNextWordOffset (Document doc, int offset, bool subword) + int FindNextWordOffset (TextDocument doc, int offset, bool subword) { if (offset + 1 >= doc.Length) return doc.Length; @@ -85,7 +85,7 @@ namespace Mono.TextEditor return result; }
- int FindPrevWordOffset (Document doc, int offset, bool subword) + int FindPrevWordOffset (TextDocument doc, int offset, bool subword) { if (offset <= 0) return 0; @@ -131,22 +131,22 @@ namespace Mono.TextEditor return result; }
- public override int FindNextWordOffset (Document doc, int offset)
+ public override int FindNextWordOffset (TextDocument doc, int offset)
{
return FindNextWordOffset (doc, offset, false);
}
- public override int FindPrevWordOffset (Document doc, int offset)
+ public override int FindPrevWordOffset (TextDocument doc, int offset)
{
return FindPrevWordOffset (doc, offset, false);
}
- public override int FindNextSubwordOffset (Document doc, int offset)
+ public override int FindNextSubwordOffset (TextDocument doc, int offset)
{
return FindNextWordOffset (doc, offset, true);
}
- public override int FindPrevSubwordOffset (Document doc, int offset)
+ public override int FindPrevSubwordOffset (TextDocument doc, int offset)
{
return FindPrevWordOffset (doc, offset, true);
} diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldMarkerMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldMarkerMargin.cs index 8904b130da..6e2a9aa7dd 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldMarkerMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldMarkerMargin.cs @@ -272,7 +272,7 @@ namespace Mono.TextEditor foldSegmentSize -= (foldSegmentSize) % 2; Cairo.Rectangle drawArea = new Cairo.Rectangle (x, y, marginWidth, lineHeight); - Document.LineState state = editor.Document.GetLineState (lineSegment); + var state = editor.Document.GetLineState (lineSegment); bool isFoldStart = false; bool isContaining = false; @@ -318,11 +318,11 @@ namespace Mono.TextEditor cr.Color = bgGC; cr.Fill (); - if (state == Document.LineState.Changed) { + if (state == TextDocument.LineState.Changed) { cr.Color = lineStateChangedGC; cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight); cr.Fill (); - } else if (state == Document.LineState.Dirty) { + } else if (state == TextDocument.LineState.Dirty) { cr.Color = lineStateDirtyGC; cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight); cr.Fill (); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs index c92aae0737..ebbe5c95f9 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldSegment.cs @@ -84,9 +84,9 @@ namespace Mono.TextEditor } public FoldingType FoldingType { get; set; } - Document doc; + TextDocument doc; - public FoldSegment (Document doc,string description,int offset,int length,FoldingType foldingType) : base (offset, length) + public FoldSegment (TextDocument doc, string description, int offset, int length, FoldingType foldingType) : base (offset, length) { this.doc = doc; this.isFolded = false; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldingScreenbackgroundRenderer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldingScreenbackgroundRenderer.cs index aafbe93e2e..e936fd1619 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldingScreenbackgroundRenderer.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/FoldingScreenbackgroundRenderer.cs @@ -44,7 +44,7 @@ namespace Mono.TextEditor Start = 1, End = 2 } - Document Document { + TextDocument Document { get { return editor.Document; } } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/IBracketMatcher.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/IBracketMatcher.cs index 1d9faba79d..476bddee5b 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/IBracketMatcher.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/IBracketMatcher.cs @@ -32,20 +32,20 @@ namespace Mono.TextEditor { public interface IBracketMatcher { - int SearchMatchingBracketForward (System.ComponentModel.BackgroundWorker worker, Document document, int offset, char openBracket, char closingBracket); - int SearchMatchingBracketBackward (System.ComponentModel.BackgroundWorker worker, Document document, int offset, char openBracket, char closingBracket); + int SearchMatchingBracketForward (System.ComponentModel.BackgroundWorker worker, TextDocument document, int offset, char openBracket, char closingBracket); + int SearchMatchingBracketBackward (System.ComponentModel.BackgroundWorker worker, TextDocument document, int offset, char openBracket, char closingBracket); } public class DefaultBracketMatcher : IBracketMatcher { - static List<string> GetList (Document document, string name) + static List<string> GetList (TextDocument document, string name) { if (document.SyntaxMode.Properties.ContainsKey(name)) return document.SyntaxMode.Properties[name]; return new List<string> (); } - static int StartsWithListMember (Document document, List<string> list, int offset) + static int StartsWithListMember (TextDocument document, List<string> list, int offset) { for (int i = 0; i < list.Count; i++) { string item = list[i]; @@ -57,7 +57,7 @@ namespace Mono.TextEditor return -1; } - public int SearchMatchingBracketForward (System.ComponentModel.BackgroundWorker worker, Document document, int offset, char openBracket, char closingBracket) + public int SearchMatchingBracketForward (System.ComponentModel.BackgroundWorker worker, TextDocument document, int offset, char openBracket, char closingBracket) { bool isInBlockComment = false; bool isInLineComment = false; @@ -125,7 +125,7 @@ namespace Mono.TextEditor } return -1; } - bool StartsInLineComment (Document document, int offset) + bool StartsInLineComment (TextDocument document, int offset) { List<string> lineComments = GetList (document, "LineComment"); LineSegment line = document.GetLineByOffset (offset); @@ -136,7 +136,7 @@ namespace Mono.TextEditor return false; } - int GetLastSourceCodePosition (Document document, int lineOffset) + int GetLastSourceCodePosition (TextDocument document, int lineOffset) { LineSegment line = document.GetLineByOffset (lineOffset); bool isInBlockComment = false; @@ -180,7 +180,7 @@ namespace Mono.TextEditor return lineOffset; } - public int SearchMatchingBracketBackward (System.ComponentModel.BackgroundWorker worker, Document document, int offset, char openBracket, char closingBracket) + public int SearchMatchingBracketBackward (System.ComponentModel.BackgroundWorker worker, TextDocument document, int offset, char openBracket, char closingBracket) { bool isInBlockComment = false; bool isInLineComment = false; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/IDocumentPartitioner.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/IDocumentPartitioner.cs deleted file mode 100644 index f9a83ceafa..0000000000 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/IDocumentPartitioner.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -// IDocumentPartitioner.cs -// -// Author: -// Mike Krüger <mkrueger@novell.com> -// -// Copyright (c) 2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -using System; -using System.Collections.Generic; - -namespace Mono.TextEditor -{ - /// <summary> - /// A document partitioner partitions a document in non overlapping regions. - /// The document partitioner listens to document changes before the event handlers are called this ensures - /// that all partitions in the document are up to date. - /// That requires that all partitioners should do incremental updates instead of re-parsings of the whole document. - /// - /// Examples for partitions are: - /// Syntax highighting spans, strings, comments, sub-language regions (asp.net <% .. %>) etc. - /// - /// </summary> - public interface IDocumentPartitioner - { - /// <summary> - /// Gets or sets the document. - /// </summary> - /// <value> - /// The document. - /// </value> - Document Document { - get; - set; - } - - /// <summary> - /// Informs the partitioner of a text replacing event. This is called before all other handlers. - /// </summary> - /// <param name='args'> - /// The arguments of the replacing event. - /// </param> - void TextReplacing (DocumentChangeEventArgs args); - - /// <summary> - /// Informs the partitioner of a text replaced event. This is called before all other handlers except the line splitter. - /// Lines have the highest priority - they need always be valid - partitions are 2nd. - /// </summary> - /// <param name='args'> - /// The arguments of the replace event. - /// </param> - void TextReplaced (DocumentChangeEventArgs args); - - /// <summary> - /// Gets the partitions between offset and offset + length; - /// </summary> - /// <returns> - /// The partitions. - /// </returns> - /// <param name='offset'> - /// The start offset. - /// </param> - /// <param name='length'> - /// The length. - /// </param> - IEnumerable<TypedSegment> GetPartitions (int offset, int length); - - /// <summary> - /// Gets the partitions in a specified segment. - /// </summary> - /// <returns> - /// The partitions. - /// </returns> - /// <param name='segment'> - /// The segment to get the partitions from. - /// </param> - IEnumerable<TypedSegment> GetPartitions (ISegment segment); - - /// <summary> - /// Gets the partition from an offset. - /// </summary> - /// <returns> - /// The partition. - /// </returns> - /// <param name='offset'> - /// The offset inside the partition. - /// </param> - TypedSegment GetPartition (int offset); - - /// <summary> - /// Gets the partition from a location. - /// </summary> - /// <returns> - /// The partition. - /// </returns> - /// <param name='location'> - /// The location inside the partition. - /// </param> - TypedSegment GetPartition (DocumentLocation location); - - /// <summary> - /// Gets the partition from a location. - /// </summary> - /// <returns> - /// The partition. - /// </returns> - /// <param name='line'> - /// The line inside the partition. - /// </param> - /// <param name='column'> - /// The column inside the partition. - /// </param> - TypedSegment GetPartition (int line, int column); - } -} - diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs index 2f4e30d39f..4646e57b3e 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs @@ -51,9 +51,9 @@ namespace Mono.TextEditor class DefaultIndentationTracker : IIndentationTracker { - Document doc; + TextDocument doc; - public DefaultIndentationTracker (Document doc) + public DefaultIndentationTracker (TextDocument doc) { this.doc = doc; } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/ISearchEngine.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/ISearchEngine.cs index eb3f1e788d..eb23a15d42 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/ISearchEngine.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/ISearchEngine.cs @@ -160,7 +160,7 @@ namespace Mono.TextEditor { if (offset < 0) return null; - Document doc = this.textEditorData.Document; + var doc = this.textEditorData.Document; if ((!string.IsNullOrEmpty (SearchRequest.SearchPattern)) && offset + searchRequest.SearchPattern.Length <= doc.Length && compiledPattern.Length > 0) { if (searchRequest.CaseSensitive) { diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/IWordFindStrategy.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/IWordFindStrategy.cs index 46f0ad3f83..e0bc8e9654 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/IWordFindStrategy.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/IWordFindStrategy.cs @@ -32,12 +32,12 @@ namespace Mono.TextEditor { public interface IWordFindStrategy { - int FindNextWordOffset (Document doc, int offset);
- int FindPrevWordOffset (Document doc, int offset);
- int FindNextSubwordOffset (Document doc, int offset);
- int FindPrevSubwordOffset (Document doc, int offset);
- int FindCurrentWordStart (Document doc, int offset);
- int FindCurrentWordEnd (Document doc, int offset);
+ int FindNextWordOffset (TextDocument doc, int offset);
+ int FindPrevWordOffset (TextDocument doc, int offset);
+ int FindNextSubwordOffset (TextDocument doc, int offset);
+ int FindPrevSubwordOffset (TextDocument doc, int offset);
+ int FindCurrentWordStart (TextDocument doc, int offset);
+ int FindCurrentWordEnd (TextDocument doc, int offset);
}
public abstract class WordFindStrategy : IWordFindStrategy
@@ -75,30 +75,30 @@ namespace Mono.TextEditor return CharacterClass.Unknown;
}
- public abstract int FindNextWordOffset (Document doc, int offset);
- public abstract int FindPrevWordOffset (Document doc, int offset);
+ public abstract int FindNextWordOffset (TextDocument doc, int offset);
+ public abstract int FindPrevWordOffset (TextDocument doc, int offset);
- public virtual int FindNextSubwordOffset (Document doc, int offset)
+ public virtual int FindNextSubwordOffset (TextDocument doc, int offset)
{
return FindNextWordOffset (doc, offset);
}
- public virtual int FindPrevSubwordOffset (Document doc, int offset)
+ public virtual int FindPrevSubwordOffset (TextDocument doc, int offset)
{
return FindPrevWordOffset (doc, offset);
}
- public virtual int FindCurrentWordStart (Document doc, int offset)
+ public virtual int FindCurrentWordStart (TextDocument doc, int offset)
{
return ScanWord (doc, offset, false);
}
- public virtual int FindCurrentWordEnd (Document doc, int offset)
+ public virtual int FindCurrentWordEnd (TextDocument doc, int offset)
{
return ScanWord (doc, offset, true);
}
- internal static int ScanWord (Document doc, int offset, bool forwardDirection)
+ internal static int ScanWord (TextDocument doc, int offset, bool forwardDirection)
{
if (offset < 0 || offset >= doc.Length)
return offset;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSegment.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSegment.cs index a9d757001d..647cb45f9a 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSegment.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSegment.cs @@ -164,7 +164,7 @@ namespace Mono.TextEditor /// <returns> /// The indentation of the line (all whitespace chars up to the first non ws char). /// </returns> - public string GetIndentation (Document doc) + public string GetIndentation (TextDocument doc) { var result = new StringBuilder (); int offset = Offset; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/SegmentTree.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/SegmentTree.cs index 1ee3bf445a..5cf5fc4463 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/SegmentTree.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/SegmentTree.cs @@ -62,12 +62,12 @@ namespace Mono.TextEditor } } - public void InstallListener (Document doc) + public void InstallListener (TextDocument doc) { doc.TextReplaced += UpdateOnTextReplace; } - public void RemoveListener (Document doc) + public void RemoveListener (TextDocument doc) { doc.TextReplaced -= UpdateOnTextReplace; } diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/SharpDevelopWordFindStrategy.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/SharpDevelopWordFindStrategy.cs index d54f155523..66b51d1233 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/SharpDevelopWordFindStrategy.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/SharpDevelopWordFindStrategy.cs @@ -32,7 +32,7 @@ namespace Mono.TextEditor { public class SharpDevelopWordFindStrategy : WordFindStrategy { - int FindNextWordOffset (Document doc, int offset, bool subword)
+ int FindNextWordOffset (TextDocument doc, int offset, bool subword)
{ int lineNumber = doc.OffsetToLineNumber (offset);
LineSegment line = doc.GetLine (lineNumber); @@ -78,7 +78,7 @@ namespace Mono.TextEditor return result;
} - int FindPrevWordOffset (Document doc, int offset, bool subword)
+ int FindPrevWordOffset (TextDocument doc, int offset, bool subword)
{
int lineNumber = doc.OffsetToLineNumber (offset);
LineSegment line = doc.GetLine (lineNumber); @@ -127,22 +127,22 @@ namespace Mono.TextEditor return result;
}
- public override int FindNextWordOffset (Document doc, int offset)
+ public override int FindNextWordOffset (TextDocument doc, int offset)
{
return FindNextWordOffset (doc, offset, false);
}
- public override int FindPrevWordOffset (Document doc, int offset)
+ public override int FindPrevWordOffset (TextDocument doc, int offset)
{
return FindPrevWordOffset (doc, offset, false);
}
- public override int FindNextSubwordOffset (Document doc, int offset)
+ public override int FindNextSubwordOffset (TextDocument doc, int offset)
{
return FindNextWordOffset (doc, offset, true);
}
- public override int FindPrevSubwordOffset (Document doc, int offset)
+ public override int FindPrevSubwordOffset (TextDocument doc, int offset)
{
return FindPrevWordOffset (doc, offset, true);
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs index 86dabe66bb..dd46a8528b 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs @@ -74,7 +74,7 @@ namespace Mono.TextEditor double mx, my; - public Document Document { + public TextDocument Document { get { return textEditorData.Document; } @@ -173,7 +173,7 @@ namespace Mono.TextEditor Dictionary<int, double> lineHeights = new Dictionary<int, double> (); - public TextEditor () : this(new Document ()) + public TextEditor () : this(new TextDocument ()) { } @@ -277,17 +277,17 @@ namespace Mono.TextEditor { } - public TextEditor (Document doc) + public TextEditor (TextDocument doc) : this (doc, null) { } - public TextEditor (Document doc, ITextEditorOptions options) + public TextEditor (TextDocument doc, ITextEditorOptions options) : this (doc, options, new SimpleEditMode ()) { } - public TextEditor (Document doc, ITextEditorOptions options, EditMode initialMode) + public TextEditor (TextDocument doc, ITextEditorOptions options, EditMode initialMode) { textEditorData = new TextEditorData (doc); textEditorData.Parent = this; @@ -359,7 +359,7 @@ namespace Mono.TextEditor #endif } - void HandleDocumenthandleEndUndo (object sender, Document.UndoOperationEventArgs e) + void HandleDocumenthandleEndUndo (object sender, TextDocument.UndoOperationEventArgs e) { if (this.Document.HeightChanged) { this.Document.HeightChanged = false; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs index 31adb0f5df..4abbd55319 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs @@ -39,7 +39,7 @@ namespace Mono.TextEditor public class TextEditorData : IDisposable { ITextEditorOptions options; - Document document; + TextDocument document; Caret caret; static Adjustment emptyAdjustment = new Adjustment (0, 0, 0, 0, 0, 0); @@ -95,11 +95,11 @@ namespace Mono.TextEditor } } - public TextEditorData () : this (new Document ()) + public TextEditorData () : this (new TextDocument ()) { } - public TextEditorData (Document doc) + public TextEditorData (TextDocument doc) { LineHeight = 16; @@ -140,7 +140,7 @@ namespace Mono.TextEditor } - public Document Document { + public TextDocument Document { get { return document; } @@ -377,7 +377,7 @@ namespace Mono.TextEditor if (Options.RemoveTrailingWhitespaces && args.Location.Line != Caret.Line) { LineSegment line = Document.GetLine (args.Location.Line); if (line != null && line.WasChanged) - Document.RemoveTrailingWhitespaces (this, line); + TextDocument.RemoveTrailingWhitespaces (this, line); } } @@ -442,7 +442,7 @@ namespace Mono.TextEditor savedSelection = Selection.Clone (MainSelection); } - void OnEndUndo (object sender, Document.UndoOperationEventArgs e) + void OnEndUndo (object sender, TextDocument.UndoOperationEventArgs e) { if (!document.IsInAtomicUndo && hasChangedInUndo) FixVirtualIndentation (); @@ -460,14 +460,14 @@ namespace Mono.TextEditor } } - void DocumentHandleUndone (object sender, Document.UndoOperationEventArgs e) + void DocumentHandleUndone (object sender, TextDocument.UndoOperationEventArgs e) { TextEditorDataState state = e.Operation.Tag as TextEditorDataState; if (state != null) state.UndoState (); } - void DocumentHandleRedone (object sender, Document.UndoOperationEventArgs e) + void DocumentHandleRedone (object sender, TextDocument.UndoOperationEventArgs e) { TextEditorDataState state = e.Operation.Tag as TextEditorDataState; if (state != null) diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextMarker.cs index de1440b9e1..4ba04f7f9e 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextMarker.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextMarker.cs @@ -110,7 +110,7 @@ namespace Mono.TextEditor int endColumn; LineSegment line; UrlType urlType; - Document doc; + TextDocument doc; public string Url { get { @@ -136,7 +136,7 @@ namespace Mono.TextEditor } } - public UrlMarker (Document doc, LineSegment line, string url, UrlType urlType, string style, int startColumn, int endColumn) + public UrlMarker (TextDocument doc, LineSegment line, string url, UrlType urlType, string style, int startColumn, int endColumn) { this.doc = doc; this.line = line; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs index 318acbf021..2c4a548be4 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs @@ -113,7 +113,7 @@ namespace Mono.TextEditor get { return this.textEditor.ColorStyle; } } - public Document Document { + public TextDocument Document { get { return textEditor.Document; } } @@ -169,7 +169,7 @@ namespace Mono.TextEditor if (selectedRegions.Count > 0) { List<ISegment> newRegions = new List<ISegment> (this.selectedRegions); - Document.UpdateSegments (newRegions, e); + TextDocument.UpdateSegments (newRegions, e); this.selectedRegions = newRegions; RefreshSearchMarker (); } @@ -354,10 +354,10 @@ namespace Mono.TextEditor } int offset = Caret.Offset - 1; - if (Caret.Mode != CaretMode.Insert || (offset >= 0 && offset < Document.Length && !Document.IsBracket (Document.GetCharAt (offset)))) + if (Caret.Mode != CaretMode.Insert || (offset >= 0 && offset < Document.Length && !TextDocument.IsBracket (Document.GetCharAt (offset)))) offset++; offset = System.Math.Max (0, offset); - if (highlightBracketOffset >= 0 && (offset >= Document.Length || !Document.IsBracket (Document.GetCharAt (offset)))) { + if (highlightBracketOffset >= 0 && (offset >= Document.Length || !TextDocument.IsBracket (Document.GetCharAt (offset)))) { int old = highlightBracketOffset; highlightBracketOffset = -1; if (old >= 0) @@ -848,7 +848,7 @@ namespace Mono.TextEditor } Dictionary<LineSegment, ChunkDescriptor> chunkDict = new Dictionary<LineSegment, ChunkDescriptor> (); - Chunk GetCachedChunks (SyntaxMode mode, Document doc, Mono.TextEditor.Highlighting.ColorSheme style, LineSegment line, int offset, int length) + Chunk GetCachedChunks (SyntaxMode mode, TextDocument doc, Mono.TextEditor.Highlighting.ColorSheme style, LineSegment line, int offset, int length) { ChunkDescriptor descriptor; if (chunkDict.TryGetValue (line, out descriptor)) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs index 7177b00c87..70722a1692 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs @@ -354,7 +354,7 @@ namespace MonoDevelop.Ide.CodeTemplates string RemoveIndent (string text, string indent) { - Document doc = new Document (); + var doc = new TextDocument (); doc.Text = text; StringBuilder result = new StringBuilder (); foreach (LineSegment line in doc.Lines) { @@ -367,7 +367,7 @@ namespace MonoDevelop.Ide.CodeTemplates string Reindent (string text, string indent) { - Document doc = new Document (); + var doc = new TextDocument (); doc.Text = text; StringBuilder result = new StringBuilder (); foreach (LineSegment line in doc.Lines) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index 3c6d37d757..7da4a7a5e2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -377,7 +377,7 @@ namespace MonoDevelop.Ide.FindInFiles var searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn); if (searchResult == null) return; - Document doc = GetDocument (searchResult); + var doc = GetDocument (searchResult); if (doc == null) return; int lineNr = doc.OffsetToLineNumber (searchResult.Offset); @@ -454,7 +454,7 @@ namespace MonoDevelop.Ide.FindInFiles return; } - Document doc = GetDocument (searchResult); + var doc = GetDocument (searchResult); if (doc == null) { textRenderer.Markup = "Can't create document for:" + searchResult.FileName; return; @@ -546,16 +546,16 @@ namespace MonoDevelop.Ide.FindInFiles - readonly Dictionary<string, Document> documents = new Dictionary<string, Document> (); + readonly Dictionary<string, TextDocument> documents = new Dictionary<string, TextDocument> (); - Document GetDocument (SearchResult result) + TextDocument GetDocument (SearchResult result) { - Document doc; + TextDocument doc; if (!documents.TryGetValue (result.FileName, out doc)) { var content = result.FileProvider.ReadString (); if (content == null) return null; - doc = Document.CreateImmutableDocument (content); + doc = TextDocument.CreateImmutableDocument (content); doc.MimeType = DesktopService.GetMimeTypeForUri (result.FileName); documents [result.FileName] = doc; @@ -600,7 +600,7 @@ namespace MonoDevelop.Ide.FindInFiles DocumentLocation GetLocation (SearchResult searchResult) { - Document doc = GetDocument (searchResult); + var doc = GetDocument (searchResult); if (doc == null) return DocumentLocation.Empty; int lineNr = doc.OffsetToLineNumber (searchResult.Offset); @@ -636,7 +636,7 @@ namespace MonoDevelop.Ide.FindInFiles if (result == null) continue; DocumentLocation loc = GetLocation (result); - Document doc = GetDocument (result); + var doc = GetDocument (result); if (doc == null) continue; LineSegment line = doc.GetLine (loc.Line); @@ -704,7 +704,7 @@ namespace MonoDevelop.Ide.FindInFiles treeviewSearchResults.Selection.SelectIter (iter); treeviewSearchResults.ScrollToCell (store.GetPath (iter), treeviewSearchResults.Columns [0], false, 0, 0); var searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn); - Document doc = GetDocument (searchResult); + var doc = GetDocument (searchResult); if (doc == null) return null; DocumentLocation location = doc.OffsetToLocation (searchResult.Offset); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs index f38ee30c18..af7a5da17c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs @@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.Gui public HiddenTextEditorViewContent () { - document = new Mono.TextEditor.Document (); + document = new Mono.TextEditor.TextDocument (); data = new Mono.TextEditor.TextEditorData (document); Name = ""; } @@ -66,7 +66,7 @@ namespace MonoDevelop.Ide.Gui } } - Mono.TextEditor.Document document; + Mono.TextEditor.TextDocument document; public string Text { get { return document.Text; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs index b1c8eea1a9..f260c97ed6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs @@ -426,7 +426,7 @@ namespace MonoDevelop.Ide.Gui return ch == ' ' || ch == '\t' || ch == '\v'; } - public static RemoveInfo GetRemoveInfo (Mono.TextEditor.Document document, ref int pos) + public static RemoveInfo GetRemoveInfo (Mono.TextEditor.TextDocument document, ref int pos) { int len = 0; while (pos > 0 && IsWhiteSpace (document.GetCharAt (pos))) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs index b045b57ad9..736134fe15 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs @@ -89,7 +89,7 @@ namespace MonoDevelop.Ide.Templates static string StripHeaderAndBlankLines (string text, CodeDomProvider provider) { - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = text; int realStartLine = 0; for (int i = 1; i <= doc.LineCount; i++) { @@ -119,7 +119,7 @@ namespace MonoDevelop.Ide.Templates return doc.GetTextAt (offset, doc.Length - offset); } - static bool IsBlankLine (Mono.TextEditor.Document doc, Mono.TextEditor.LineSegment line) + static bool IsBlankLine (Mono.TextEditor.TextDocument doc, Mono.TextEditor.LineSegment line) { for (int i = 0; i < line.EditableLength; i++) { if (!Char.IsWhiteSpace (doc.GetCharAt (line.Offset + i))) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs index 3f2a95fa05..c236541630 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs @@ -280,7 +280,7 @@ namespace MonoDevelop.Ide.Templates ms.Write (data, 0, data.Length); } - Mono.TextEditor.Document doc = new Mono.TextEditor.Document (); + Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument (); doc.Text = content; TextStylePolicy textPolicy = policyParent != null ? policyParent.Policies.Get<TextStylePolicy> ("text/plain") diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs index 97ca54be4b..b199919fbb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs @@ -231,7 +231,7 @@ namespace MonoDevelop.Ide static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (IUnresolvedTypeDefinition part) { var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (part.Region.FileName); - var doc = new Mono.TextEditor.Document (); + var doc = new Mono.TextEditor.TextDocument (); doc.Text = provider.ReadString (); int position = doc.LocationToOffset (part.Region.BeginLine, part.Region.BeginColumn); while (position + part.Name.Length < doc.Length) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/CodeGenerationService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/CodeGenerationService.cs index 53ef6e47fb..861e91eb08 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/CodeGenerationService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/CodeGenerationService.cs @@ -252,7 +252,7 @@ namespace MonoDevelop.TypeSystem return result; } - static void CheckEndPoint (Document doc, InsertionPoint point, bool isStartPoint) + static void CheckEndPoint (TextDocument doc, InsertionPoint point, bool isStartPoint) { LineSegment line = doc.GetLine (point.Location.Line); if (line == null) @@ -264,7 +264,7 @@ namespace MonoDevelop.TypeSystem point.LineAfter = NewLineInsertion.Eol; } - static void CheckStartPoint (Document doc, InsertionPoint point, bool isEndPoint) + static void CheckStartPoint (TextDocument doc, InsertionPoint point, bool isEndPoint) { LineSegment line = doc.GetLine (point.Location.Line); if (line == null) @@ -284,7 +284,7 @@ namespace MonoDevelop.TypeSystem point.LineAfter = isEndPoint ? NewLineInsertion.Eol : NewLineInsertion.BlankLine; } - static InsertionPoint GetInsertionPosition (Document doc, int line, int column) + static InsertionPoint GetInsertionPosition (TextDocument doc, int line, int column) { int bodyEndOffset = doc.LocationToOffset (line, column) + 1; LineSegment curLine = doc.GetLine (line); diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/DocumentTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/DocumentTests.cs index f18d73518d..283c51e846 100644 --- a/main/tests/UnitTests/Mono.TextEditor.Tests/DocumentTests.cs +++ b/main/tests/UnitTests/Mono.TextEditor.Tests/DocumentTests.cs @@ -37,7 +37,7 @@ namespace Mono.TextEditor.Tests [Test()] public void TestDocumentCreation () { - Document document = new Mono.TextEditor.Document (); + var document = new Mono.TextEditor.TextDocument (); string text = "1234567890\n" +
@@ -59,7 +59,7 @@ namespace Mono.TextEditor.Tests [Test]
public void TestDocumentInsert ()
{
- Document document = new Mono.TextEditor.Document (); + var document = new Mono.TextEditor.TextDocument (); string top = "1234567890\n";
string text =
@@ -81,7 +81,7 @@ namespace Mono.TextEditor.Tests [Test]
public void TestDocumentRemove ()
{
- Document document = new Mono.TextEditor.Document (); + var document = new Mono.TextEditor.TextDocument (); string top = "1234567890\n";
string testText =
@@ -109,7 +109,7 @@ namespace Mono.TextEditor.Tests [Test]
public void TestDocumentBug1Test()
{
- Document document = new Mono.TextEditor.Document (); + var document = new Mono.TextEditor.TextDocument (); string top = "1234567890";
document.Text = top;
@@ -128,7 +128,7 @@ namespace Mono.TextEditor.Tests [Test]
public void TestDocumentBug2Test()
{
- Document document = new Mono.TextEditor.Document (); + var document = new Mono.TextEditor.TextDocument (); string top = "123\n456\n789\n0";
string testText = "Hello World!";
@@ -146,7 +146,7 @@ namespace Mono.TextEditor.Tests [Test]
public void SplitterTest ()
{ - Document document = new Mono.TextEditor.Document (); + var document = new Mono.TextEditor.TextDocument (); for (int i = 0; i < 100; i++) { ((IBuffer)document).Insert (0, new string ('c', i) + Environment.NewLine); } diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs index a7a3e653c5..405dd4bd96 100644 --- a/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs +++ b/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs @@ -36,7 +36,7 @@ namespace Mono.TextEditor.Tests [TestFixture()] public class FoldingTests { - static List<FoldSegment> GetFoldSegments (Document doc) + static List<FoldSegment> GetFoldSegments (TextDocument doc) { List<FoldSegment> result = new List<FoldSegment> (); Stack<FoldSegment> foldSegments = new Stack<FoldSegment> (); diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs index 98fdaf186e..45690a811f 100644 --- a/main/tests/UnitTests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs +++ b/main/tests/UnitTests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs @@ -46,7 +46,7 @@ namespace Mono.TextEditor.Tests public static string GetMarkup (string input, string syntaxMode) { - Document doc = new Document (); + var doc = new TextDocument (); doc.SyntaxMode = SyntaxModeService.GetSyntaxMode (doc, syntaxMode); doc.Text = input; return doc.SyntaxMode.GetMarkup (TextEditorOptions.DefaultOptions, SyntaxModeService.GetColorStyle (null, "TangoLight"), 0, doc.Length, false); diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/TextBreakerTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/TextBreakerTests.cs index 038e6c6c5e..c57c3c1c8f 100644 --- a/main/tests/UnitTests/Mono.TextEditor.Tests/TextBreakerTests.cs +++ b/main/tests/UnitTests/Mono.TextEditor.Tests/TextBreakerTests.cs @@ -95,7 +95,7 @@ namespace Mono.TextEditor.Tests public TextEditor CreateEditor (string editorText) { - return new TextEditor (new Document (editorText)); + return new TextEditor (new TextDocument (editorText)); } public List<ISegment> BreakAllLines (String editorText) diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/ViTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/ViTests.cs index 1d0263e7e1..9e705f6643 100644 --- a/main/tests/UnitTests/Mono.TextEditor.Tests/ViTests.cs +++ b/main/tests/UnitTests/Mono.TextEditor.Tests/ViTests.cs @@ -294,7 +294,7 @@ kkk lll", mode.Text); get { return base.Data; } } - public new Document Document { + public new TextDocument Document { get { return base.Document; } } diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/VirtualSpacesTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/VirtualSpacesTests.cs index 3f75bbc6cf..da01211e29 100644 --- a/main/tests/UnitTests/Mono.TextEditor.Tests/VirtualSpacesTests.cs +++ b/main/tests/UnitTests/Mono.TextEditor.Tests/VirtualSpacesTests.cs @@ -94,7 +94,7 @@ namespace Mono.TextEditor.Tests data.Caret.AllowCaretBehindLineEnd = true; data.Caret.Offset = 2; // 2nd.Line Assert.AreEqual (DocumentLocation.MinColumn + 1, data.Caret.Column); - Document.RemoveTrailingWhitespaces (data, data.Document.GetLine (2)); + TextDocument.RemoveTrailingWhitespaces (data, data.Document.GetLine (2)); Assert.AreEqual ("\n\n\n", data.Document.Text); Assert.AreEqual (DocumentLocation.MinColumn + 1, data.Caret.Column); } diff --git a/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs b/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs index 5a2d506045..9de455ec8b 100644 --- a/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs +++ b/main/tests/UnitTests/MonoDevelop.CSharpBinding/TestViewContent.cs @@ -50,7 +50,7 @@ namespace MonoDevelop.CSharpBinding.Tests }
public TestViewContent () { - document = new Mono.TextEditor.Document (); + document = new Mono.TextEditor.TextDocument (); data = new TextEditorData (document);
Name = "";
}
@@ -71,7 +71,7 @@ namespace MonoDevelop.CSharpBinding.Tests }
}
- Mono.TextEditor.Document document; + Mono.TextEditor.TextDocument document; public string Text {
get {
return document.Text;
|