@@ -814,7 +814,7 @@ export class DebugService implements debug.IDebugService {
814
814
return this . doCreateProcess ( workspace , resolvedConfig , sessionId ) ;
815
815
} ) ;
816
816
817
- return this . runPreLaunchTask ( sessionId , workspace , resolvedConfig . preLaunchTask ) . then ( ( taskSummary : ITaskSummary ) => {
817
+ return this . runTask ( sessionId , workspace , resolvedConfig . preLaunchTask ) . then ( ( taskSummary : ITaskSummary ) => {
818
818
const errorCount = resolvedConfig . preLaunchTask ? this . markerService . getStatistics ( ) . errors : 0 ;
819
819
const successExitCode = taskSummary && taskSummary . exitCode === 0 ;
820
820
const failureExitCode = taskSummary && taskSummary . exitCode !== undefined && taskSummary . exitCode !== 0 ;
@@ -995,15 +995,15 @@ export class DebugService implements debug.IDebugService {
995
995
} ) ;
996
996
}
997
997
998
- private runPreLaunchTask ( sessionId : string , root : IWorkspaceFolder , taskName : string ) : TPromise < ITaskSummary > {
998
+ private runTask ( sessionId : string , root : IWorkspaceFolder , taskName : string ) : TPromise < ITaskSummary > {
999
999
if ( ! taskName ) {
1000
1000
return TPromise . as ( null ) ;
1001
1001
}
1002
1002
1003
1003
// run a task before starting a debug session
1004
1004
return this . taskService . getTask ( root , taskName ) . then ( task => {
1005
1005
if ( ! task ) {
1006
- return TPromise . wrapError ( errors . create ( nls . localize ( 'DebugTaskNotFound' , "Could not find the preLaunchTask \'{0}\'." , taskName ) ) ) ;
1006
+ return TPromise . wrapError ( errors . create ( nls . localize ( 'DebugTaskNotFound' , "Could not find the task \'{0}\'." , taskName ) ) ) ;
1007
1007
}
1008
1008
1009
1009
function once ( kind : TaskEventKind , event : Event < TaskEvent > ) : Event < TaskEvent > {
@@ -1047,7 +1047,7 @@ export class DebugService implements debug.IDebugService {
1047
1047
1048
1048
setTimeout ( ( ) => {
1049
1049
if ( ! taskStarted ) {
1050
- e ( { severity : severity . Error , message : nls . localize ( 'taskNotTracked' , "The preLaunchTask '{0}' cannot be tracked." , taskName ) } ) ;
1050
+ e ( { severity : severity . Error , message : nls . localize ( 'taskNotTracked' , "The task '{0}' cannot be tracked." , taskName ) } ) ;
1051
1051
}
1052
1052
} , 10000 ) ;
1053
1053
} ) ;
@@ -1142,6 +1142,9 @@ export class DebugService implements debug.IDebugService {
1142
1142
if ( process ) {
1143
1143
process . inactive = true ;
1144
1144
this . _onDidEndProcess . fire ( process ) ;
1145
+ if ( process . configuration . postDebugTask ) {
1146
+ this . runTask ( process . getId ( ) , process . session . root , process . configuration . postDebugTask ) ;
1147
+ }
1145
1148
}
1146
1149
1147
1150
this . toDisposeOnSessionEnd . set ( session . getId ( ) , lifecycle . dispose ( this . toDisposeOnSessionEnd . get ( session . getId ( ) ) ) ) ;
0 commit comments