Skip to content

Commit

Permalink
Debounce updating notebook debug decorators (#210010)
Browse files Browse the repository at this point in the history
Debounce updating notebook debug decotrators
  • Loading branch information
DonJayamanne committed Apr 10, 2024
1 parent e079f1e commit bbeea75
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { Delayer } from 'vs/base/common/async';
import { Disposable } from 'vs/base/common/lifecycle';
import { IRange, Range } from 'vs/editor/common/core/range';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
Expand Down Expand Up @@ -34,11 +35,12 @@ export class PausedCellDecorationContribution extends Disposable implements INot
) {
super();

const delayer = this._register(new Delayer(200));
this._register(_debugService.getModel().onDidChangeCallStack(() => this.updateExecutionDecorations()));
this._register(_debugService.getViewModel().onDidFocusStackFrame(() => this.updateExecutionDecorations()));
this._register(_notebookExecutionStateService.onDidChangeExecution(e => {
if (e.type === NotebookExecutionType.cell && this._notebookEditor.textModel && e.affectsNotebook(this._notebookEditor.textModel.uri)) {
this.updateExecutionDecorations();
delayer.trigger(() => this.updateExecutionDecorations());
}
}));
}
Expand Down

0 comments on commit bbeea75

Please sign in to comment.