public AddOverload ( MonoDevelop.Ide.CodeCompletion.CompletionData data, |
||
data | MonoDevelop.Ide.CodeCompletion.CompletionData | |
cancelToken | ||
Résultat | Task |
protected override Window CreateTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item) { var doc = IdeApp.Workbench.ActiveDocument; if (doc == null) return null; var titem = item.Item as TTI; if (titem == null) return null; var result = new TooltipInformationWindow (); result.ShowArrow = true; foreach(var i in AmbiguousType.TryDissolve(titem.t)) { if (i == null) continue; var tooltipInformation = TooltipInfoGen.Create(i, editor.ColorStyle); if (tooltipInformation != null && !string.IsNullOrEmpty(tooltipInformation.SignatureMarkup)) result.AddOverload(tooltipInformation); } if (result.Overloads < 1) { result.Dispose (); return null; } result.RepositionWindow (); return result; }
bool DelayedTooltipShow() { var selectedItem = List.SelectedItem; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return(false); } var data = completionDataList [selectedItem]; IEnumerable <ICompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; } else { filteredOverloads = new ICompletionData[] { data }; } EnsureDeclarationViewWindow(); if (data != currentData) { declarationviewwindow.Clear(); var overloads = new List <ICompletionData> (filteredOverloads); foreach (var overload in overloads) { declarationviewwindow.AddOverload((CompletionData)overload); } currentData = data; if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return(false); } if (declarationViewHidden && Visible) { RepositionDeclarationViewWindow(); } declarationViewTimer = 0; return(false); }
async void DelayedTooltipShowAsync() { var selectedItem = List.SelectedItemIndex; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return; } var data = completionDataList [selectedItem]; IEnumerable <CompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; } else { filteredOverloads = new CompletionData[] { data }; } EnsureDeclarationViewWindow(); if (data != currentData) { declarationviewwindow.Clear(); currentData = data; var cs = new CancellationTokenSource(); declarationViewCancelSource = cs; var overloads = new List <CompletionData> (filteredOverloads); overloads.Sort(ListWidget.overloadComparer); foreach (var overload in overloads) { await declarationviewwindow.AddOverload((CompletionData)overload, cs.Token); } if (cs.IsCancellationRequested) { return; } if (declarationViewCancelSource == cs) { declarationViewCancelSource = null; } if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return; } if (declarationViewHidden && Visible) { RepositionDeclarationViewWindow(); } declarationViewTimer = 0; }
protected override Gtk.Window CreateTooltipWindow (Mono.TextEditor.TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item) { var doc = IdeApp.Workbench.ActiveDocument; if (doc == null) return null; var titem = (ToolTipData)item.Item; var tooltipInformation = CreateTooltip (titem, offset, null); if (tooltipInformation == null || string.IsNullOrEmpty (tooltipInformation.SignatureMarkup)) return null; var result = new TooltipInformationWindow (); result.ShowArrow = true; result.AddOverload (tooltipInformation); result.RepositionWindow (); return result; }
public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState) { var doc = ctx; if (doc == null) return null; var titem = (ToolTipData)item.Item; var tooltipInformation = CreateTooltip (titem, editor, ctx, offset, modifierState); if (tooltipInformation == null || string.IsNullOrEmpty (tooltipInformation.SignatureMarkup)) return null; var result = new TooltipInformationWindow (); result.ShowArrow = true; result.AddOverload (tooltipInformation); result.RepositionWindow (); return result; }
public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState) { var doc = ctx; if (doc == null) return null; var result = new TooltipInformationWindow (); result.ShowArrow = true; result.AddOverload ((TooltipInformation)item.Item); result.RepositionWindow (); return result; }
bool DelayedTooltipShow() { var selectedItem = List.SelectedItem; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return(false); } var data = completionDataList [selectedItem]; IEnumerable <ICompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; if (PropertyService.Get("HideObsoleteItems", false)) { filteredOverloads = filteredOverloads.Where(x => !x.DisplayFlags.HasFlag(DisplayFlags.Obsolete)); } } else { filteredOverloads = new ICompletionData[] { data }; } if (data != currentData) { declarationviewwindow.Clear(); var overloads = new List <ICompletionData> (filteredOverloads); foreach (var overload in overloads) { declarationviewwindow.AddOverload((CompletionData)overload); } currentData = data; if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return(false); } Gdk.Rectangle rect = List.GetRowArea(selectedItem); if (rect.IsEmpty || rect.Bottom < (int)List.vadj.Value || rect.Y > List.Allocation.Height + (int)List.vadj.Value) { return(false); } if (declarationViewHidden && Visible) { declarationviewwindow.ShowArrow = true; int ox; int oy; base.GdkWindow.GetOrigin(out ox, out oy); declarationviewwindow.MaximumYTopBound = oy; int y = rect.Y + Theme.Padding - (int)List.vadj.Value; declarationviewwindow.ShowPopup(this, new Gdk.Rectangle(Gui.Styles.TooltipInfoSpacing, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left); declarationViewHidden = false; } declarationViewTimer = 0; return(false); }