@@ -11,7 +11,6 @@ import { SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
1111import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService' ;
1212import { IPanelService } from 'vs/workbench/services/panel/common/panelService' ;
1313import { TogglePanelAction } from 'vs/workbench/browser/panel' ;
14- import { IDisposable , dispose } from 'vs/base/common/lifecycle' ;
1514import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler' ;
1615import { IThemeService } from 'vs/platform/theme/common/themeService' ;
1716import { IContextViewService } from 'vs/platform/contextview/browser/contextView' ;
@@ -67,11 +66,9 @@ export class ToggleOrSetOutputScrollLockAction extends Action {
6766 public static readonly ID = 'workbench.output.action.toggleOutputScrollLock' ;
6867 public static readonly LABEL = nls . localize ( { key : 'toggleOutputScrollLock' , comment : [ 'Turn on / off automatic output scrolling' ] } , "Toggle Output Scroll Lock" ) ;
6968
70- private toDispose : IDisposable [ ] = [ ] ;
71-
7269 constructor ( id : string , label : string , @IOutputService private readonly outputService : IOutputService ) {
7370 super ( id , label , 'output-action output-scroll-unlock' ) ;
74- this . toDispose . push ( this . outputService . onActiveOutputChannel ( channel => {
71+ this . _register ( this . outputService . onActiveOutputChannel ( channel => {
7572 const activeChannel = this . outputService . getActiveChannel ( ) ;
7673 if ( activeChannel ) {
7774 this . setClassAndLabel ( activeChannel . scrollLock ) ;
@@ -104,11 +101,6 @@ export class ToggleOrSetOutputScrollLockAction extends Action {
104101 this . label = nls . localize ( 'outputScrollOff' , "Turn Auto Scrolling Off" ) ;
105102 }
106103 }
107-
108- public dispose ( ) {
109- super . dispose ( ) ;
110- this . toDispose = dispose ( this . toDispose ) ;
111- }
112104}
113105
114106export class SwitchOutputAction extends Action {
@@ -188,15 +180,13 @@ export class OpenLogOutputFile extends Action {
188180 public static readonly ID = 'workbench.output.action.openLogOutputFile' ;
189181 public static readonly LABEL = nls . localize ( 'openInLogViewer' , "Open Log File" ) ;
190182
191- private disposables : IDisposable [ ] = [ ] ;
192-
193183 constructor (
194184 @IOutputService private readonly outputService : IOutputService ,
195185 @IEditorService private readonly editorService : IEditorService ,
196186 @IInstantiationService private readonly instantiationService : IInstantiationService
197187 ) {
198188 super ( OpenLogOutputFile . ID , OpenLogOutputFile . LABEL , 'output-action open-log-file' ) ;
199- this . outputService . onActiveOutputChannel ( this . update , this , this . disposables ) ;
189+ this . _register ( this . outputService . onActiveOutputChannel ( this . update , this ) ) ;
200190 this . update ( ) ;
201191 }
202192
0 commit comments