@@ -141,6 +141,8 @@ export class SolutionConverterImpl implements SolutionConverter {
141141
142142 let detection = false ;
143143 let convertResult : rpc . ConvertSolutionResult = { success : false } ;
144+ let availableCompilers : string [ ] = [ ] ;
145+ let availableConfigurations : rpc . VariablesConfiguration [ ] | undefined ;
144146 if ( ! missingPacksResult || missingPacksResult . success ) {
145147 // rpc method: ConvertSolution
146148 outputChannel . append ( 'Convert solution... ' ) ;
@@ -158,20 +160,15 @@ export class SolutionConverterImpl implements SolutionConverter {
158160 }
159161
160162 // compilers and variables detection: gather locally and emit configure event
161- const availableCompilers = convertResult . selectCompiler ?? [ ] ;
163+ availableCompilers = convertResult . selectCompiler ?? [ ] ;
162164 detection = availableCompilers . length > 0 ;
163- let availableConfigurations : rpc . VariablesConfiguration [ ] | undefined ;
164165 if ( convertResult . undefinedLayers ) {
165166 const result = await this . checkDiscoverLayers ( ) ;
166167 const discoverLayersOutput = ! result . success && result . message ? [ `error csolution: ${ result . message . trim ( ) } ` ] : [ ] ;
167168 toolsOutputMessages = toolsOutputMessages . concat ( discoverLayersOutput ) ;
168169 availableConfigurations = result . configurations ;
169170 detection = detection || result . success ;
170171 }
171- if ( detection ) {
172- // compilers and variables detection handling: apply select-compiler and discover layer configurations if any
173- this . eventHub . fireConfigureSolutionDataReady ( { availableCompilers, availableConfigurations } ) ;
174- }
175172 }
176173
177174 let logResult = undefined ;
@@ -216,6 +213,10 @@ export class SolutionConverterImpl implements SolutionConverter {
216213 logMessages : logResult ,
217214 toolsOutputMessages,
218215 } ) ;
216+ // compilers and variables detection handling:
217+ // apply select-compiler and discover layer configurations, reset state otherwise
218+ this . eventHub . fireConfigureSolutionDataReady ( { availableCompilers, availableConfigurations } ) ;
219+
219220 }
220221
221222 private async printErrorsWarnings ( messages ?: rpc . LogMessages ) : Promise < void > {
0 commit comments