@@ -81,12 +81,12 @@ class InstanceManager {
8181
8282class VariableResolver {
8383
84- constructor ( public workspaceFolder : IWorkspaceFolder | undefined , public taskSystemInfo : TaskSystemInfo | undefined , private _values : Map < string , string > , private _service : IConfigurationResolverService | undefined ) {
84+ constructor ( public workspaceFolder : IWorkspaceFolder | undefined , public taskSystemInfo : TaskSystemInfo | undefined , public readonly values : Map < string , string > , private _service : IConfigurationResolverService | undefined ) {
8585 }
8686 resolve ( value : string ) : string {
8787 return value . replace ( / \$ \{ ( .* ?) \} / g, ( match : string , variable : string ) => {
8888 // Strip out the ${} because the map contains them variables without those characters.
89- let result = this . _values . get ( match . substring ( 2 , match . length - 1 ) ) ;
89+ let result = this . values . get ( match . substring ( 2 , match . length - 1 ) ) ;
9090 if ( ( result !== undefined ) && ( result !== null ) ) {
9191 return result ;
9292 }
@@ -840,7 +840,7 @@ export class TerminalTaskSystem implements ITaskSystem {
840840 } , ( _error ) => {
841841 // The process never got ready. Need to think how to handle this.
842842 } ) ;
843- this . _onDidStateChange . fire ( TaskEvent . create ( TaskEventKind . Start , task , terminal . id ) ) ;
843+ this . _onDidStateChange . fire ( TaskEvent . create ( TaskEventKind . Start , task , terminal . id , resolver . values ) ) ;
844844 const mapKey = task . getMapKey ( ) ;
845845 this . busyTasks [ mapKey ] = task ;
846846 this . _onDidStateChange . fire ( TaskEvent . create ( TaskEventKind . Active , task ) ) ;
@@ -1331,6 +1331,22 @@ export class TerminalTaskSystem implements ITaskSystem {
13311331 this . collectCommandVariables ( variables , task . command , task ) ;
13321332 }
13331333 this . collectMatcherVariables ( variables , task . configurationProperties . problemMatchers ) ;
1334+
1335+ if ( task . command . runtime === RuntimeType . CustomExecution && CustomTask . is ( task ) ) {
1336+ this . collectDefinitionVariables ( variables , task . _source . config . element ) ;
1337+ }
1338+ }
1339+
1340+ private collectDefinitionVariables ( variables : Set < string > , definition : any ) : void {
1341+ for ( const key in definition ) {
1342+ if ( Types . isString ( definition [ key ] ) ) {
1343+ this . collectVariables ( variables , definition [ key ] ) ;
1344+ } else if ( Types . isArray ( definition [ key ] ) ) {
1345+ definition [ key ] . forEach ( ( element : any ) => this . collectDefinitionVariables ( variables , element ) ) ;
1346+ } else if ( Types . isObject ( definition [ key ] ) ) {
1347+ this . collectDefinitionVariables ( variables , definition [ key ] ) ;
1348+ }
1349+ }
13341350 }
13351351
13361352 private collectCommandVariables ( variables : Set < string > , command : CommandConfiguration , task : CustomTask | ContributedTask ) : void {
0 commit comments