@@ -25,7 +25,7 @@ import { IDragAndDropData } from 'vs/base/browser/dnd';
2525import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView' ;
2626import { FuzzyScore } from 'vs/base/common/filters' ;
2727import { IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel' ;
28- import { variableSetEmitter , VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView' ;
28+ import { VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView' ;
2929import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
3030import { dispose } from 'vs/base/common/lifecycle' ;
3131import { IViewDescriptorService } from 'vs/workbench/common/views' ;
@@ -34,12 +34,12 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
3434import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
3535
3636const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024 ;
37- let ignoreVariableSetEmitter = false ;
37+ let ignoreViewUpdates = false ;
3838let useCachedEvaluation = false ;
3939
4040export class WatchExpressionsView extends ViewPane {
4141
42- private onWatchExpressionsUpdatedScheduler : RunOnceScheduler ;
42+ private watchExpressionsUpdatedScheduler : RunOnceScheduler ;
4343 private needsRefresh = false ;
4444 private tree ! : WorkbenchAsyncDataTree < IDebugService | IExpression , IExpression , FuzzyScore > ;
4545
@@ -58,7 +58,7 @@ export class WatchExpressionsView extends ViewPane {
5858 ) {
5959 super ( options , keybindingService , contextMenuService , configurationService , contextKeyService , viewDescriptorService , instantiationService , openerService , themeService , telemetryService ) ;
6060
61- this . onWatchExpressionsUpdatedScheduler = new RunOnceScheduler ( ( ) => {
61+ this . watchExpressionsUpdatedScheduler = new RunOnceScheduler ( ( ) => {
6262 this . needsRefresh = false ;
6363 this . tree . updateChildren ( ) ;
6464 } , 50 ) ;
@@ -117,19 +117,19 @@ export class WatchExpressionsView extends ViewPane {
117117 return ;
118118 }
119119
120- if ( ! this . onWatchExpressionsUpdatedScheduler . isScheduled ( ) ) {
121- this . onWatchExpressionsUpdatedScheduler . schedule ( ) ;
120+ if ( ! this . watchExpressionsUpdatedScheduler . isScheduled ( ) ) {
121+ this . watchExpressionsUpdatedScheduler . schedule ( ) ;
122122 }
123123 } ) ) ;
124- this . _register ( variableSetEmitter . event ( ( ) => {
125- if ( ! ignoreVariableSetEmitter ) {
124+ this . _register ( this . debugService . getViewModel ( ) . onWillUpdateViews ( ( ) => {
125+ if ( ! ignoreViewUpdates ) {
126126 this . tree . updateChildren ( ) ;
127127 }
128128 } ) ) ;
129129
130130 this . _register ( this . onDidChangeBodyVisibility ( visible => {
131131 if ( visible && this . needsRefresh ) {
132- this . onWatchExpressionsUpdatedScheduler . schedule ( ) ;
132+ this . watchExpressionsUpdatedScheduler . schedule ( ) ;
133133 }
134134 } ) ) ;
135135 let horizontalScrolling : boolean | undefined ;
@@ -291,9 +291,9 @@ export class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
291291 onFinish : ( value : string , success : boolean ) => {
292292 if ( success && value ) {
293293 this . debugService . renameWatchExpression ( expression . getId ( ) , value ) ;
294- ignoreVariableSetEmitter = true ;
295- variableSetEmitter . fire ( ) ;
296- ignoreVariableSetEmitter = false ;
294+ ignoreViewUpdates = true ;
295+ this . debugService . getViewModel ( ) . updateViews ( ) ;
296+ ignoreViewUpdates = false ;
297297 } else if ( ! expression . name ) {
298298 this . debugService . removeWatchExpressions ( expression . getId ( ) ) ;
299299 }
0 commit comments