From 2246ff3e88cb21295a641d046a466107bef19a95 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 9 Jun 2026 12:57:45 +0200 Subject: [PATCH] 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 --- ILSpy/TextView/DecompilerTextView.axaml.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ILSpy/TextView/DecompilerTextView.axaml.cs b/ILSpy/TextView/DecompilerTextView.axaml.cs index 1699e1a55..cbcdaf4fa 100644 --- a/ILSpy/TextView/DecompilerTextView.axaml.cs +++ b/ILSpy/TextView/DecompilerTextView.axaml.cs @@ -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 contextMenuEntries = Array.Empty(); readonly Popup richPopup; @@ -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 void CloseTooltip() { - lastTooltipSegment = null; ToolTip.SetIsOpen(Editor.TextArea.TextView, false); } @@ -916,7 +913,6 @@ namespace ILSpy.TextView void OnRichPopupClosed(object? sender, EventArgs e) { - lastTooltipSegment = null; distanceToPopupLimit = double.PositiveInfinity; }