@@ -14,7 +14,7 @@ import * as arrays from '../../../../base/common/arrays.js';
1414import { RunOnceScheduler } from '../../../../base/common/async.js' ;
1515import { Codicon } from '../../../../base/common/codicons.js' ;
1616import * as errors from '../../../../base/common/errors.js' ;
17- import { DisposableStore , dispose , IDisposable , markAsSingleton , MutableDisposable } from '../../../../base/common/lifecycle.js' ;
17+ import { DisposableStore , markAsSingleton , MutableDisposable } from '../../../../base/common/lifecycle.js' ;
1818import { Platform , platform } from '../../../../base/common/platform.js' ;
1919import { ThemeIcon } from '../../../../base/common/themables.js' ;
2020import { URI } from '../../../../base/common/uri.js' ;
@@ -392,7 +392,7 @@ export function createDisconnectMenuItemAction(action: MenuItemAction, disposabl
392392
393393// Debug toolbar
394394
395- const debugViewTitleItems : IDisposable [ ] = [ ] ;
395+ const debugViewTitleItems = new DisposableStore ( ) ;
396396const registerDebugToolBarItem = ( id : string , title : string | ICommandActionTitle , order : number , icon ?: { light ?: URI ; dark ?: URI } | ThemeIcon , when ?: ContextKeyExpression , precondition ?: ContextKeyExpression , alt ?: ICommandAction ) => {
397397 MenuRegistry . appendMenuItem ( MenuId . DebugToolBar , {
398398 group : 'navigation' ,
@@ -408,7 +408,7 @@ const registerDebugToolBarItem = (id: string, title: string | ICommandActionTitl
408408 } ) ;
409409
410410 // Register actions in debug viewlet when toolbar is docked
411- debugViewTitleItems . push ( MenuRegistry . appendMenuItem ( MenuId . ViewContainerTitle , {
411+ debugViewTitleItems . add ( MenuRegistry . appendMenuItem ( MenuId . ViewContainerTitle , {
412412 group : 'navigation' ,
413413 when : ContextKeyExpr . and ( when , ContextKeyExpr . equals ( 'viewContainer' , VIEWLET_ID ) , CONTEXT_DEBUG_STATE . notEqualsTo ( 'inactive' ) , ContextKeyExpr . equals ( 'config.debug.toolBarLocation' , 'docked' ) ) ,
414414 order,
@@ -424,10 +424,10 @@ const registerDebugToolBarItem = (id: string, title: string | ICommandActionTitl
424424markAsSingleton ( MenuRegistry . onDidChangeMenu ( e => {
425425 // In case the debug toolbar is docked we need to make sure that the docked toolbar has the up to date commands registered #115945
426426 if ( e . has ( MenuId . DebugToolBar ) ) {
427- dispose ( debugViewTitleItems ) ;
427+ debugViewTitleItems . clear ( ) ;
428428 const items = MenuRegistry . getMenuItems ( MenuId . DebugToolBar ) ;
429429 for ( const i of items ) {
430- debugViewTitleItems . push ( MenuRegistry . appendMenuItem ( MenuId . ViewContainerTitle , {
430+ debugViewTitleItems . add ( MenuRegistry . appendMenuItem ( MenuId . ViewContainerTitle , {
431431 ...i ,
432432 when : ContextKeyExpr . and ( i . when , ContextKeyExpr . equals ( 'viewContainer' , VIEWLET_ID ) , CONTEXT_DEBUG_STATE . notEqualsTo ( 'inactive' ) , ContextKeyExpr . equals ( 'config.debug.toolBarLocation' , 'docked' ) )
433433 } ) ) ;
0 commit comments