diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2018-04-17 19:45:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 19:45:49 +0300 |
commit | 0a9d5590b5e68857ef98b96b3b70ca69c01cbd9b (patch) | |
tree | 5f8f66567fe7f9c1a80ab325d11be17fc77f2df8 /main/src/core | |
parent | 345cfd1a81eb0bb1536e5b67e1bbade2fd2f78ef (diff) | |
parent | f9d5d8d7a98588cb7ddd0a7d1c72ed9bc30a7516 (diff) |
Merge pull request #4573 from mono/master-issue4393
Fixes issue #4393 Error in text editor The original error should be
Diffstat (limited to 'main/src/core')
6 files changed, 16 insertions, 11 deletions
diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Highlighting/XmlReadHelper.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Highlighting/XmlReadHelper.cs index bdf9ab1eb7..0f671a295e 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Highlighting/XmlReadHelper.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Highlighting/XmlReadHelper.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Xml; +using MonoDevelop.Core; namespace Mono.TextEditor.Highlighting { @@ -81,7 +82,7 @@ namespace Mono.TextEditor.Highlighting case XmlNodeType.EndElement: if (endNodes.Contains (reader.LocalName)) return; - Console.WriteLine ("Unknown end node: " + reader.LocalName + " valid end nodes are: " + ConcatString (endNodes)); + LoggingService.LogWarning ("Unknown end node: " + reader.LocalName + " valid end nodes are: " + ConcatString (endNodes)); break; case XmlNodeType.Element: if (!didReadStartNode && endNodes.Contains (reader.LocalName)) { @@ -90,7 +91,7 @@ namespace Mono.TextEditor.Highlighting } bool validNode = callback (data); if (!validNode) - Console.WriteLine ("Unknown node: " + reader.LocalName); + LoggingService.LogWarning ("Unknown node: " + reader.LocalName); if (data.SkipNextRead) goto skip; break; diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Actions/ClipboardActions.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Actions/ClipboardActions.cs index c0894e600b..50aac021c9 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Actions/ClipboardActions.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Actions/ClipboardActions.cs @@ -214,7 +214,7 @@ namespace Mono.TextEditor try { copyData = pasteHandler.GetCopyData (segment.Offset, segment.Length); } catch (Exception e) { - Console.WriteLine ("Exception while getting copy data:" + e); + LoggingService.LogError ("Exception while getting copy data", e); } } break; diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/DiffTracker.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/DiffTracker.cs index 2246c19076..ea9c688707 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/DiffTracker.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/DiffTracker.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; using Mono.TextEditor.Utils; +using MonoDevelop.Core; using MonoDevelop.Ide.Editor; namespace Mono.TextEditor @@ -85,7 +86,7 @@ namespace Mono.TextEditor var lineNumber = startLine.LineNumber; lineStates.RemoveRange (lineNumber, endRemoveLine.LineNumber - lineNumber); } catch (Exception ex) { - Console.WriteLine ("error while DiffTracker.TrackDocument_TextChanging:" + ex); + LoggingService.LogError ("error while DiffTracker.TrackDocument_TextChanging", ex); } } } @@ -112,7 +113,7 @@ namespace Mono.TextEditor if (trackDocument != null) trackDocument.CommitMultipleLineUpdate (lineNumber, lineNumber + insertedLines); } catch (Exception ex) { - Console.WriteLine ("error while DiffTracker.TrackDocument_TextChanged:" + ex); + LoggingService.LogError ("error while DiffTracker.TrackDocument_TextChanged", ex); } } } diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/EditMode.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/EditMode.cs index 6667e35639..ae4787a81a 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/EditMode.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/EditMode.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using Gdk; using MonoDevelop.Components; using MonoDevelop.Ide.Editor; +using MonoDevelop.Core; using Microsoft.CodeAnalysis.Text; namespace Mono.TextEditor @@ -228,7 +229,7 @@ namespace Mono.TextEditor var sb = new System.Text.StringBuilder ("Error while executing actions "); foreach (var action in actions) sb.AppendFormat (" {0}", action); - Console.WriteLine (sb.ToString () + ": " + e); + LoggingService.LogError (sb.ToString (), e); } } diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorData.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorData.cs index 48dfa4bf99..8e0f9cc6a6 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorData.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorData.cs @@ -31,6 +31,7 @@ using System.IO; using System.Diagnostics; using Mono.TextEditor.Highlighting; using Xwt.Drawing; +using MonoDevelop.Core; using MonoDevelop.Core.Text; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Extension; @@ -1418,7 +1419,7 @@ namespace Mono.TextEditor try { newText = TextPasteHandler.FormatPlainText (offset, text, copyData); } catch (Exception e) { - Console.WriteLine ("Text paste handler exception:" + e); + LoggingService.LogError ("Text paste handler exception", e); newText = text; } if (newText != text) { diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs index 7e9e50ae55..e2bc62f70c 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs @@ -26,6 +26,7 @@ using System; using System.Diagnostics; +using MonoDevelop.Core; using Mono.TextEditor.Highlighting; using MonoDevelop.Ide.Editor.Highlighting; @@ -395,8 +396,8 @@ namespace Mono.TextEditor if (font == null) { try { font = Pango.FontDescription.FromString (FontName); - } catch { - Console.WriteLine ("Could not load font: {0}", FontName); + } catch (Exception e) { + LoggingService.LogError ("Could not load font: " + FontName, e); } if (font == null || String.IsNullOrEmpty (font.Family)) font = Pango.FontDescription.FromString (DEFAULT_FONT); @@ -426,8 +427,8 @@ namespace Mono.TextEditor try { if (!string.IsNullOrEmpty (GutterFontName)) gutterFont = Pango.FontDescription.FromString (GutterFontName); - } catch { - Console.WriteLine ("Could not load gutter font: {0}", GutterFontName); + } catch (Exception e) { + LoggingService.LogError ("Could not load gutter font: " + GutterFontName, e); } if (gutterFont == null || String.IsNullOrEmpty (gutterFont.Family)) gutterFont = Gtk.Widget.DefaultStyle.FontDescription.Copy (); |