Skip to content

Commit fbe6c87

Browse files
committed
Allow toggling details for tooltips as well
1 parent 62501b1 commit fbe6c87

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎External/Plugins/ASCompletion/Completion/ASComplete.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,8 @@ static public string GetToolTipText(ASResult result)
37923792

37933793
private static string GetToolTipDoc(MemberModel model)
37943794
{
3795-
return ASDocumentation.GetTipShortDetails(model, null).TrimStart(new char[] { ' ', '\u2026' });
3795+
string details = (UITools.Manager.ShowDetails) ? ASDocumentation.GetTipFullDetails(model, null) : ASDocumentation.GetTipShortDetails(model, null);
3796+
return details.TrimStart(new char[] { ' ', '\u2026' });
37963797
}
37973798

37983799
static private string MemberTooltipText(MemberModel member, ClassModel inClass)

‎External/Plugins/ASCompletion/PluginMain.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
403403
}
404404
e.Handled = true;
405405
}
406+
407+
else if (command == "ASCompletion.RefreshTooltip")
408+
{
409+
OnMouseHover(sci, lastHoverPosition);
410+
e.Handled = true;
411+
}
406412
}
407413

408414
// Create a fake document from a FileModel
@@ -855,11 +861,15 @@ private void OnChar(ScintillaNet.ScintillaControl Sci, int Value)
855861
ASComplete.OnChar(Sci, Value, true);
856862
}
857863

864+
private int lastHoverPosition;
865+
858866
private void OnMouseHover(ScintillaNet.ScintillaControl sci, int position)
859867
{
860868
if (!ASContext.Context.IsFileValid)
861869
return;
862870

871+
lastHoverPosition = position;
872+
863873
// get word at mouse position
864874
int style = sci.BaseStyleAt(position);
865875
if (!ASComplete.IsTextStyle(style))

‎PluginCore/PluginCore/Controls/UITools.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,16 @@ private bool HandleKeys(Keys key)
376376
}
377377
return true;
378378
}
379+
380+
// toggle "long-description" for the hover tooltip
381+
if (key == Keys.F1)
382+
{
383+
showDetails = !showDetails;
384+
DataEvent de = new DataEvent(EventType.Command, "ASCompletion.RefreshTooltip", null);
385+
EventManager.DispatchEvent(this, de);
386+
return true;
387+
}
388+
379389
// are we currently displaying something?
380390
if (!CompletionList.Active && !callTip.CallTipActive) return false;
381391

0 commit comments

Comments
 (0)