diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs index 45dc49b306..9e90b4c685 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs @@ -26,24 +26,25 @@ // using System; -using Mono.TextEditor; +using MonoDevelop.Ide.Editor; +using MonoDevelop.Components; namespace MonoDevelop.SourceEditor { - - - public class CompileErrorTooltipProvider: TooltipProvider + class CompileErrorTooltipProvider: TooltipProvider { - - public CompileErrorTooltipProvider() + internal static ExtensibleTextEditor GetExtensibleTextEditor (TextEditor editor) { + var view = editor.GetContent<SourceEditorView> (); + if (view == null) + return null; + return view.TextEditor; } #region ITooltipProvider implementation - - public override TooltipItem GetItem (Mono.TextEditor.TextEditor editor, int offset) + public override TooltipItem GetItem (TextEditor editor, DocumentContext ctx, int offset) { - var ed = editor as ExtensibleTextEditor; + var ed = GetExtensibleTextEditor (editor); if (ed == null) return null; @@ -51,25 +52,23 @@ namespace MonoDevelop.SourceEditor if (string.IsNullOrEmpty (errorInformation)) return null; - return new TooltipItem (errorInformation, editor.Document.GetLineByOffset (offset)); + return new TooltipItem (errorInformation, editor.GetLineByOffset (offset)); } - - protected override Gtk.Window CreateTooltipWindow (Mono.TextEditor.TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item) + + public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState) { - LanguageItemWindow result = new LanguageItemWindow ((ExtensibleTextEditor) editor, modifierState, null, (string)item.Item, null); + var result = new LanguageItemWindow (GetExtensibleTextEditor (editor), modifierState, null, (string)item.Item, null); if (result.IsEmpty) return null; return result; } - protected override void GetRequiredPosition (Mono.TextEditor.TextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign) + public override void GetRequiredPosition (TextEditor editor, Control tipWindow, out int requiredWidth, out double xalign) { - LanguageItemWindow win = (LanguageItemWindow) tipWindow; + var win = (LanguageItemWindow) tipWindow; requiredWidth = win.SetMaxWidth (win.Screen.Width); xalign = 0.5; } - #endregion - } } |