@@ -162,21 +162,16 @@ export class SolutionConverterImpl implements SolutionConverter {
162162 detection = availableCompilers . length > 0 ;
163163 let availableConfigurations : rpc . VariablesConfiguration [ ] | undefined ;
164164 if ( convertResult . undefinedLayers ) {
165- const discoverResult = await this . checkDiscoverLayers ( ) ;
166- availableConfigurations = discoverResult . configurations ;
167- detection = detection || discoverResult . success ;
165+ const result = await this . checkDiscoverLayers ( ) ;
166+ const discoverLayersOutput = ! result . success && result . message ? [ `error csolution: ${ result . message . trim ( ) } ` ] : [ ] ;
167+ toolsOutputMessages = toolsOutputMessages . concat ( discoverLayersOutput ) ;
168+ availableConfigurations = result . configurations ;
169+ detection = detection || result . success ;
168170 }
169171 if ( detection ) {
172+ // compilers and variables detection handling: apply select-compiler and discover layer configurations if any
170173 this . eventHub . fireConfigureSolutionDataReady ( { availableCompilers, availableConfigurations } ) ;
171174 }
172- // compilers and variables detection handling: apply select-compiler and discover layer configurations if any
173- csolution ?. setSelectCompiler ( convertResult . selectCompiler ) ;
174- if ( convertResult . undefinedLayers ) {
175- const [ discoverLayersDetected , discoverLayersOutput ] = await this . checkDiscoverLayers ( ) ;
176- detection = discoverLayersDetected ;
177- toolsOutputMessages = toolsOutputMessages . concat ( discoverLayersOutput ) ;
178- }
179- detection = detection || ! ! convertResult . selectCompiler ;
180175 }
181176
182177 let logResult = undefined ;
@@ -258,7 +253,7 @@ export class SolutionConverterImpl implements SolutionConverter {
258253 return formattedOutput ;
259254 }
260255
261- private async checkDiscoverLayers ( ) : Promise < [ boolean , string [ ] ] > {
256+ private async checkDiscoverLayers ( ) {
262257 const outputChannel = this . outputChannelProvider . getOrCreate ( manifest . CMSIS_SOLUTION_OUTPUT_CHANNEL ) ;
263258 // rpc method: DiscoverLayers
264259 outputChannel . append ( 'Discover Layers... ' ) ;
@@ -269,10 +264,7 @@ export class SolutionConverterImpl implements SolutionConverter {
269264 activeTarget : this . data ?. targetSet ?? '' ,
270265 }
271266 ) as rpc . DiscoverLayersInfo ;
272- return { success : result . success , configurations : result . configurations } ;
273- this . solutionManager . getCsolution ( ) ?. setVariablesConfigurations ( result . configurations ) ;
274- const formattedOutput = ! result . success && result . message ? [ `error csolution: ${ result . message . trim ( ) } ` ] : [ ] ;
275- return [ result . success , formattedOutput ] ;
267+ return result ;
276268 }
277269
278270 private getSeverity ( messages : rpc . LogMessages , lines ?: string [ ] ) : Severity {
0 commit comments