@@ -182,20 +182,21 @@ class ConfigureTaskRunnerAction extends Action {
182182 }
183183 let contentPromise : TPromise < string > ;
184184 if ( selection . autoDetect ) {
185- this . outputService . showOutput ( TaskService . OutputChannel ) ;
186- this . outputService . append ( TaskService . OutputChannel , nls . localize ( 'ConfigureTaskRunnerAction.autoDetecting' , 'Auto detecting tasks for {0}' , selection . id ) + '\n' ) ;
185+ this . outputService . showOutput ( TaskService . OutputChannelId ) ;
186+ const outputChannel = this . outputService . getOutputChannel ( TaskService . OutputChannelId ) ;
187+ outputChannel . append ( nls . localize ( 'ConfigureTaskRunnerAction.autoDetecting' , 'Auto detecting tasks for {0}' , selection . id ) + '\n' ) ;
187188 let detector = new ProcessRunnerDetector ( this . fileService , this . contextService , new SystemVariables ( this . editorService , this . contextService ) ) ;
188189 contentPromise = detector . detect ( false , selection . id ) . then ( ( value ) => {
189190 let config = value . config ;
190191 if ( value . stderr && value . stderr . length > 0 ) {
191192 value . stderr . forEach ( ( line ) => {
192- this . outputService . append ( TaskService . OutputChannel , line + '\n' ) ;
193+ outputChannel . append ( line + '\n' ) ;
193194 } ) ;
194195 this . messageService . show ( Severity . Warning , nls . localize ( 'ConfigureTaskRunnerAction.autoDetect' , 'Auto detecting the task system failed. Using default template. Consult the task output for details.' ) ) ;
195196 return selection . content ;
196197 } else if ( config ) {
197198 if ( value . stdout && value . stdout . length > 0 ) {
198- value . stdout . forEach ( line => this . outputService . append ( TaskService . OutputChannel , line + '\n' ) ) ;
199+ value . stdout . forEach ( line => outputChannel . append ( line + '\n' ) ) ;
199200 }
200201 let content = JSON . stringify ( config , null , '\t' ) ;
201202 content = [
@@ -287,7 +288,7 @@ class ShowLogAction extends AbstractTaskAction {
287288 }
288289
289290 public run ( ) : Promise {
290- return this . outputService . showOutput ( TaskService . OutputChannel ) ;
291+ return this . outputService . showOutput ( TaskService . OutputChannelId ) ;
291292 }
292293}
293294
@@ -452,7 +453,7 @@ interface TaskServiceEventData {
452453class TaskService extends EventEmitter implements ITaskService {
453454 public serviceId = ITaskService ;
454455 public static SERVICE_ID : string = 'taskService' ;
455- public static OutputChannel :string = 'tasks' ;
456+ public static OutputChannelId :string = 'tasks' ;
456457 public static OutputChannelLabel :string = nls . localize ( 'tasks' , "Tasks" ) ;
457458
458459 private modeService : IModeService ;
@@ -545,8 +546,9 @@ class TaskService extends EventEmitter implements ITaskService {
545546 }
546547 }
547548 if ( isAffected ) {
548- this . outputService . append ( TaskService . OutputChannel , nls . localize ( 'TaskSystem.invalidTaskJson' , 'Error: The content of the tasks.json file has syntax errors. Please correct them before executing a task.\n' ) ) ;
549- this . outputService . showOutput ( TaskService . OutputChannel , true ) ;
549+ const outputChannel = this . outputService . getOutputChannel ( TaskService . OutputChannelId ) ;
550+ outputChannel . append ( nls . localize ( 'TaskSystem.invalidTaskJson' , 'Error: The content of the tasks.json file has syntax errors. Please correct them before executing a task.\n' ) ) ;
551+ this . outputService . showOutput ( TaskService . OutputChannelId , true ) ;
550552 return TPromise . wrapError ( { } ) ;
551553 }
552554 }
@@ -594,7 +596,7 @@ class TaskService extends EventEmitter implements ITaskService {
594596 if ( config . buildSystem === 'service' ) {
595597 result = new LanguageServiceTaskSystem ( < LanguageServiceTaskConfiguration > config , this . telemetryService , this . modeService ) ;
596598 } else if ( this . isRunnerConfig ( config ) ) {
597- result = new ProcessRunnerSystem ( < FileConfig . ExternalTaskRunnerConfiguration > config , variables , this . markerService , this . modelService , this . telemetryService , this . outputService , TaskService . OutputChannel , clearOutput ) ;
599+ result = new ProcessRunnerSystem ( < FileConfig . ExternalTaskRunnerConfiguration > config , variables , this . markerService , this . modelService , this . telemetryService , this . outputService , TaskService . OutputChannelId , clearOutput ) ;
598600 }
599601 if ( result === null ) {
600602 this . _taskSystemPromise = null ;
@@ -618,9 +620,10 @@ class TaskService extends EventEmitter implements ITaskService {
618620 if ( stderr && stderr . length > 0 ) {
619621 stderr . forEach ( ( line ) => {
620622 result = false ;
621- this . outputService . append ( TaskService . OutputChannel , line + '\n' ) ;
623+ const outputChannel = this . outputService . getOutputChannel ( TaskService . OutputChannelId ) ;
624+ outputChannel . append ( line + '\n' ) ;
622625 } ) ;
623- this . outputService . showOutput ( TaskService . OutputChannel , true ) ;
626+ this . outputService . showOutput ( TaskService . OutputChannelId , true ) ;
624627 }
625628 return result ;
626629 }
@@ -784,7 +787,7 @@ class TaskService extends EventEmitter implements ITaskService {
784787 this . messageService . show ( Severity . Error , nls . localize ( 'TaskSystem.unknownError' , 'An error has occurred while running a task. See task log for details.' ) ) ;
785788 }
786789 if ( showOutput ) {
787- this . outputService . showOutput ( TaskService . OutputChannel , true ) ;
790+ this . outputService . showOutput ( TaskService . OutputChannelId , true ) ;
788791 }
789792 }
790793}
@@ -832,7 +835,7 @@ if (Env.enableTasks) {
832835
833836 // Output channel
834837 let outputChannelRegistry = < IOutputChannelRegistry > Registry . as ( OutputExt . OutputChannels ) ;
835- outputChannelRegistry . registerChannel ( TaskService . OutputChannel , TaskService . OutputChannelLabel ) ;
838+ outputChannelRegistry . registerChannel ( TaskService . OutputChannelId , TaskService . OutputChannelLabel ) ;
836839
837840 ( < IWorkbenchContributionsRegistry > Registry . as ( WorkbenchExtensions . Workbench ) ) . registerWorkbenchContribution ( TaskServiceParticipant ) ;
838841
0 commit comments