Browse Source

Drop the write-only lastTooltipSegment field

The decompiler text view's lastTooltipSegment was assigned on hover and
cleared on close but never read anywhere, so it tracked nothing. Remove
the field and its three assignments.

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3755/head
Siegfried Pammer 4 weeks ago
parent
commit
2246ff3e88
  1. 4
      ILSpy/TextView/DecompilerTextView.axaml.cs

4
ILSpy/TextView/DecompilerTextView.axaml.cs

@ -85,7 +85,6 @@ namespace ILSpy.TextView @@ -85,7 +85,6 @@ namespace ILSpy.TextView
// TODO: drop this field and use Editor.ScrollToVerticalOffset once #594 ships and we bump the package.
ScrollViewer? editorScrollViewer;
DisplaySettings? currentDisplaySettings;
ReferenceSegment? lastTooltipSegment;
ReferenceSegment? lastRightClickedSegment;
IReadOnlyList<IContextMenuEntryExport> contextMenuEntries = Array.Empty<IContextMenuEntryExport>();
readonly Popup richPopup;
@ -809,7 +808,6 @@ namespace ILSpy.TextView @@ -809,7 +808,6 @@ namespace ILSpy.TextView
var content = BuildHoverContent(model, segment);
if (content == null)
return;
lastTooltipSegment = segment;
if (content.Value.IsRich)
OpenRichPopup(content.Value.Control);
else
@ -904,7 +902,6 @@ namespace ILSpy.TextView @@ -904,7 +902,6 @@ namespace ILSpy.TextView
void CloseTooltip()
{
lastTooltipSegment = null;
ToolTip.SetIsOpen(Editor.TextArea.TextView, false);
}
@ -916,7 +913,6 @@ namespace ILSpy.TextView @@ -916,7 +913,6 @@ namespace ILSpy.TextView
void OnRichPopupClosed(object? sender, EventArgs e)
{
lastTooltipSegment = null;
distanceToPopupLimit = double.PositiveInfinity;
}

Loading…
Cancel
Save