77import { TPromise } from 'vs/base/common/winjs.base' ;
88import nls = require( 'vs/nls' ) ;
99import { Registry } from 'vs/platform/platform' ;
10- import arrays = require( 'vs/base/common/arrays' ) ;
1110import { IAction , Action } from 'vs/base/common/actions' ;
1211import { EditorAction } from 'vs/editor/common/editorAction' ;
1312import { Behaviour } from 'vs/editor/common/editorActionEnablement' ;
@@ -39,7 +38,7 @@ export class ToggleOutputAction extends Action {
3938 return TPromise . as ( null ) ;
4039 }
4140
42- return this . outputService . getOutputChannel ( this . outputService . getActiveChannel ( ) ) . show ( ) ;
41+ return this . outputService . getOutputChannel ( this . outputService . getActiveChannelId ( ) ) . show ( ) ;
4342 }
4443}
4544
@@ -53,7 +52,7 @@ export class ClearOutputAction extends Action {
5352 }
5453
5554 public run ( ) : TPromise < any > {
56- this . outputService . getOutputChannel ( this . outputService . getActiveChannel ( ) ) . clear ( ) ;
55+ this . outputService . getOutputChannel ( this . outputService . getActiveChannelId ( ) ) . clear ( ) ;
5756 this . panelService . getActivePanel ( ) . focus ( ) ;
5857
5958 return TPromise . as ( true ) ;
@@ -84,7 +83,7 @@ export class ClearOutputEditorAction extends EditorAction {
8483 }
8584
8685 public run ( ) : TPromise < boolean > {
87- this . outputService . getOutputChannel ( this . outputService . getActiveChannel ( ) ) . clear ( ) ;
86+ this . outputService . getOutputChannel ( this . outputService . getActiveChannelId ( ) ) . clear ( ) ;
8887 return TPromise . as ( false ) ;
8988 }
9089}
@@ -110,22 +109,20 @@ export class SwitchOutputActionItem extends SelectActionItem {
110109 action : IAction ,
111110 @IOutputService private outputService : IOutputService
112111 ) {
113- super ( null , action , SwitchOutputActionItem . getChannels ( outputService ) , Math . max ( 0 , SwitchOutputActionItem . getChannels ( outputService ) . indexOf ( outputService . getActiveChannel ( ) ) ) ) ;
112+ super ( null , action , SwitchOutputActionItem . getChannels ( outputService ) , Math . max ( 0 , SwitchOutputActionItem . getChannels ( outputService ) . indexOf ( outputService . getActiveChannelId ( ) ) ) ) ;
114113 this . toDispose . push ( this . outputService . onOutputChannel ( this . onOutputChannel , this ) ) ;
115114 this . toDispose . push ( this . outputService . onActiveOutputChannel ( this . onOutputChannel , this ) ) ;
116115 }
117116
118117 private onOutputChannel ( ) : void {
119118 let channels = SwitchOutputActionItem . getChannels ( this . outputService ) ;
120- let selected = Math . max ( 0 , channels . indexOf ( this . outputService . getActiveChannel ( ) ) ) ;
119+ let selected = Math . max ( 0 , channels . indexOf ( this . outputService . getActiveChannelId ( ) ) ) ;
121120
122121 this . setOptions ( channels , selected ) ;
123122 }
124123
125124 private static getChannels ( outputService : IOutputService ) : string [ ] {
126125 const contributedChannels = ( < IOutputChannelRegistry > Registry . as ( Extensions . OutputChannels ) ) . getChannels ( ) . map ( channelData => channelData . id ) ;
127- const usedChannels = outputService . getChannels ( ) ;
128-
129- return arrays . distinct ( contributedChannels . concat ( usedChannels ) ) . sort ( ) ; // sort by name
126+ return contributedChannels . sort ( ) ; // sort by name
130127 }
131128}
0 commit comments