diff options
author | Greg Munn <gregm@microsoft.com> | 2019-11-14 19:40:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 19:40:32 +0300 |
commit | 1fc745240bbcbfeae9530a954cb45650daf77fcb (patch) | |
tree | 8b71334abe8d3c0794acab1bb8ba770b2b3c5b80 | |
parent | f3447877bc5cbbc707863d77be3873996045b319 (diff) | |
parent | 4607466a97fe73791db5848b00e6ccc8f452f5bb (diff) |
Merge pull request #9296 from mono/backport-pr-9293-to-release-8.4
[release-8.4] [Debugger] Update pinned watches when variables change
2 files changed, 19 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchAdornmentManager.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchAdornmentManager.cs index 27feca882b..e357a3df30 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchAdornmentManager.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchAdornmentManager.cs @@ -59,6 +59,7 @@ namespace MonoDevelop.Debugger.VSTextView.PinnedWatches DebuggingService.PinnedWatches.WatchRemoved += OnWatchRemoved; DebuggingService.DebugSessionStarted += OnDebugSessionStarted; DebuggingService.StoppedEvent += OnDebuggingSessionStopped; + DebuggingService.VariableChanged += OnVariableChanged; this.layer = textView.GetXPlatAdornmentLayer ("PinnedWatch"); this.cocoaViewFactory = cocoaViewFactory; @@ -102,6 +103,17 @@ namespace MonoDevelop.Debugger.VSTextView.PinnedWatches adornments.Remove (e.Watch); } + private void OnVariableChanged (object sender, EventArgs e) + { + if (!debugging) + return; + + foreach (var watch in adornments) { + var view = (PinnedWatchView)((ICocoaMaterialView)watch.Value).ContentView; + view.Refresh (); + } + } + SnapshotSpan GetSnapshotSpan (PinnedWatch watch) { var newSpan = textView.TextSnapshot.SpanFromMDColumnAndLine (watch.Line, watch.Column, watch.EndLine, watch.EndColumn); @@ -201,6 +213,8 @@ namespace MonoDevelop.Debugger.VSTextView.PinnedWatches DebuggingService.PinnedWatches.WatchRemoved -= OnWatchRemoved; DebuggingService.DebugSessionStarted -= OnDebugSessionStarted; DebuggingService.StoppedEvent -= OnDebuggingSessionStopped; + DebuggingService.VariableChanged -= OnVariableChanged; + textView.LayoutChanged -= OnTextViewLayoutChanged; } } diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs index 6827a7ae10..c4f994e08f 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs @@ -78,6 +78,11 @@ namespace MonoDevelop.Debugger.VSTextView.PinnedWatches treeView.Resized += OnTreeViewResized; } + public void Refresh() + { + controller.Root.Children [0].Refresh (); + } + public void SetObjectValue (ObjectValue value) { if (value == objectValue) |