@@ -12,7 +12,7 @@ import { IMarkerService } from 'vs/platform/markers/common/markers';
12
12
import { IThemeService } from 'vs/platform/theme/common/themeService' ;
13
13
import { IActiveNotebookEditor , ICellViewModel , INotebookEditor , INotebookViewCellsUpdateEvent } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
14
14
import { CellKind , NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
15
- import { INotebookExecutionStateService , NotebookExecutionType } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService' ;
15
+ import { INotebookExecutionStateService , NotebookExecutionType , type ICellExecutionStateChangedEvent , type IExecutionStateChangedEvent } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService' ;
16
16
import { OutlineChangeEvent , OutlineConfigKeys , OutlineTarget } from 'vs/workbench/services/outline/browser/outline' ;
17
17
import { OutlineEntry } from './OutlineEntry' ;
18
18
import { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel' ;
@@ -83,11 +83,16 @@ export class NotebookCellOutlineProvider {
83
83
this . _onDidChange . fire ( { } ) ;
84
84
} ) ) ;
85
85
86
- this . _disposables . add ( notebookExecutionStateService . onDidChangeExecution ( e => {
87
- if ( e . type === NotebookExecutionType . cell && ! ! this . _editor . textModel && e . affectsNotebook ( this . _editor . textModel ?. uri ) ) {
88
- this . _recomputeState ( ) ;
89
- }
90
- } ) ) ;
86
+ this . _disposables . add (
87
+ Event . debounce < ICellExecutionStateChangedEvent | IExecutionStateChangedEvent > (
88
+ notebookExecutionStateService . onDidChangeExecution ,
89
+ ( last , _current ) => last ?? _current ,
90
+ 200 ) ( e => {
91
+ if ( e . type === NotebookExecutionType . cell && ! ! this . _editor . textModel && e . affectsNotebook ( this . _editor . textModel ?. uri ) ) {
92
+ this . _recomputeState ( ) ;
93
+ }
94
+ } )
95
+ ) ;
91
96
92
97
this . _recomputeState ( ) ;
93
98
}
0 commit comments