File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,30 @@ class NotebookKernelDetection extends Disposable implements IWorkbenchContributi
68
68
}
69
69
} ) ) ;
70
70
71
- this . _register ( this . _extensionService . onDidChangeExtensionsStatus ( ( ) => {
72
- for ( const [ notebookType , task ] of this . _detectionMap ) {
73
- if ( this . _extensionService . activationEventIsDone ( `onNotebook: ${ notebookType } ` ) ) {
74
- task . dispose ( ) ;
75
- }
71
+ let timer : any = null ;
72
+
73
+ this . _localDisposableStore . add ( this . _extensionService . onDidChangeExtensionsStatus ( ( ) => {
74
+ if ( timer ) {
75
+ clearTimeout ( timer ) ;
76
76
}
77
+
78
+ // activation state might not be updated yet, postpone to next frame
79
+ timer = setTimeout ( ( ) => {
80
+ for ( const [ notebookType , task ] of this . _detectionMap ) {
81
+ if ( this . _extensionService . activationEventIsDone ( `onNotebook:${ notebookType } ` ) ) {
82
+ task . dispose ( ) ;
83
+ }
84
+ }
85
+ } ) ;
77
86
} ) ) ;
87
+
88
+ this . _localDisposableStore . add ( {
89
+ dispose : ( ) => {
90
+ if ( timer ) {
91
+ clearTimeout ( timer ) ;
92
+ }
93
+ }
94
+ } ) ;
78
95
}
79
96
}
80
97
}
You can’t perform that action at this time.
0 commit comments