Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 1fc7452

Browse files
authored
Merge pull request #9296 from mono/backport-pr-9293-to-release-8.4
[release-8.4] [Debugger] Update pinned watches when variables change
2 parents f344787 + 4607466 commit 1fc7452

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchAdornmentManager.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public PinnedWatchAdornmentManager (ICocoaViewFactory cocoaViewFactory, ICocoaTe
5959
DebuggingService.PinnedWatches.WatchRemoved += OnWatchRemoved;
6060
DebuggingService.DebugSessionStarted += OnDebugSessionStarted;
6161
DebuggingService.StoppedEvent += OnDebuggingSessionStopped;
62+
DebuggingService.VariableChanged += OnVariableChanged;
6263

6364
this.layer = textView.GetXPlatAdornmentLayer ("PinnedWatch");
6465
this.cocoaViewFactory = cocoaViewFactory;
@@ -102,6 +103,17 @@ void OnWatchRemoved (object sender, PinnedWatchEventArgs e)
102103
adornments.Remove (e.Watch);
103104
}
104105

106+
private void OnVariableChanged (object sender, EventArgs e)
107+
{
108+
if (!debugging)
109+
return;
110+
111+
foreach (var watch in adornments) {
112+
var view = (PinnedWatchView)((ICocoaMaterialView)watch.Value).ContentView;
113+
view.Refresh ();
114+
}
115+
}
116+
105117
SnapshotSpan GetSnapshotSpan (PinnedWatch watch)
106118
{
107119
var newSpan = textView.TextSnapshot.SpanFromMDColumnAndLine (watch.Line, watch.Column, watch.EndLine, watch.EndColumn);
@@ -201,6 +213,8 @@ public void Dispose ()
201213
DebuggingService.PinnedWatches.WatchRemoved -= OnWatchRemoved;
202214
DebuggingService.DebugSessionStarted -= OnDebugSessionStarted;
203215
DebuggingService.StoppedEvent -= OnDebuggingSessionStopped;
216+
DebuggingService.VariableChanged -= OnVariableChanged;
217+
204218
textView.LayoutChanged -= OnTextViewLayoutChanged;
205219
}
206220
}

main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public PinnedWatchView (PinnedWatch watch, StackFrame frame)
7878
treeView.Resized += OnTreeViewResized;
7979
}
8080

81+
public void Refresh()
82+
{
83+
controller.Root.Children [0].Refresh ();
84+
}
85+
8186
public void SetObjectValue (ObjectValue value)
8287
{
8388
if (value == objectValue)

0 commit comments

Comments
 (0)