@@ -112,12 +112,11 @@ export class SolutionConverterImpl implements SolutionConverter {
112112
113113 // restart rpc server to pick up new environment variables
114114 if ( this . data ?. restartRpc ) {
115- outputChannel . appendLine ( '🔄 Environment changed: restarting RPC server...' ) ;
116- await this . cmsisToolboxManager . runCsolutionRpc ( 'Shutdown' , { } ,
117- line => outputChannel . appendLine ( line ) ) ;
118- await this . cmsisToolboxManager . runCsolutionRpc ( 'LoadPacks' , { } ,
119- line => outputChannel . appendLine ( line ) ) ;
120- outputChannel . appendLine ( '' ) ;
115+ outputChannel . append ( '🔄 Environment changed: restarting RPC server... ' ) ;
116+ await this . cmsisToolboxManager . runCsolutionRpc ( 'Shutdown' , { } ) ;
117+ outputChannel . append ( 'Loading packs... ' ) ;
118+ await this . cmsisToolboxManager . runCsolutionRpc ( 'LoadPacks' , { } ) ;
119+ outputChannel . append ( '\n\n' ) ;
121120 }
122121
123122 if ( signal . aborted ) {
@@ -127,13 +126,13 @@ export class SolutionConverterImpl implements SolutionConverter {
127126 outputChannel . appendLine ( '⚙️ Converting solution...' ) ;
128127 if ( this . isDownloadPacksEnabled ( ) ) {
129128 // rpc method: ListMissingPacks
129+ outputChannel . append ( 'Check for missing packs... ' ) ;
130130 const result = await this . cmsisToolboxManager . runCsolutionRpc (
131131 'ListMissingPacks' ,
132132 {
133133 solution : activeSolution ,
134134 activeTarget : activeTarget ,
135- } ,
136- line => outputChannel . appendLine ( line )
135+ }
137136 ) as rpc . ListMissingPacksResult ;
138137 if ( result . success && result . packs && result . packs . length > 0 ) {
139138 // download missing packs if any
@@ -145,14 +144,14 @@ export class SolutionConverterImpl implements SolutionConverter {
145144 }
146145
147146 // rpc method: ConvertSolution
147+ outputChannel . append ( 'Convert solution... ' ) ;
148148 const result = await this . cmsisToolboxManager . runCsolutionRpc (
149149 'ConvertSolution' ,
150150 {
151151 solution : activeSolution ,
152152 activeTarget : activeTarget ,
153153 updateRte : this . data . updateRte ?? false ,
154- } ,
155- line => outputChannel . appendLine ( line )
154+ }
156155 ) as rpc . ConvertSolutionResult ;
157156
158157 if ( signal . aborted ) {
@@ -168,13 +167,13 @@ export class SolutionConverterImpl implements SolutionConverter {
168167 if ( ! detection ) {
169168 if ( result . success ) {
170169 // check if compile commands need to be updated: call cbuild setup skipping csolution convert step
170+ outputChannel . append ( 'Setup database... ' ) ;
171171 [ result . success , cbuildOutput ] = await this . compileCommandsGenerator . runCbuildSetup ( ) ;
172- outputChannel . appendLine ( `${ result . success ? '☑️' : '🟥' } cbuild setup database` ) ;
173172 }
174173 // rpc method: GetLogMessages
174+ outputChannel . append ( 'Get log messages... ' ) ;
175175 logResult = await this . cmsisToolboxManager . runCsolutionRpc (
176- 'GetLogMessages' , { } ,
177- line => outputChannel . appendLine ( line )
176+ 'GetLogMessages' , { }
178177 ) as rpc . LogMessages ;
179178 if ( logResult ?. errors || logResult ?. warnings ) {
180179 this . printErrorsWarnings ( logResult ) ;
@@ -191,32 +190,33 @@ export class SolutionConverterImpl implements SolutionConverter {
191190 csolution ?. setLogMessages ( logResult ) ;
192191
193192 // print result to output channel
194- outputChannel . appendLine ( detection ?
195- '⏳ Action needed: see Configure Solution dialog' :
196- severity == 'error' ?
197- '🟥 Convert solution failed' :
198- severity == 'warning' ?
199- '🟨 Convert solution completed with warnings' :
200- '✅ Convert solution completed'
201- ) ;
202- outputChannel . appendLine ( ' ') ;
193+ outputChannel . append ( '\n' + (
194+ detection ?
195+ '⏳ Action needed: see Configure Solution dialog' :
196+ severity == 'error' ?
197+ '🟥 Convert solution failed' :
198+ severity == 'warning' ?
199+ '🟨 Convert solution completed with warnings' :
200+ '✅ Convert solution completed'
201+ ) + '\n\n ') ;
203202 // notify conversion result and detection status asynchronously!
204203 this . eventHub . fireConvertCompleted ( { severity : severity , detection : detection } ) ;
205204 }
206205
207206 private async printErrorsWarnings ( messages ?: rpc . LogMessages ) : Promise < void > {
208207 const outputChannel = this . outputChannelProvider . getOrCreate ( manifest . CMSIS_SOLUTION_OUTPUT_CHANNEL ) ;
209208 for ( const message of messages ?. errors ?? [ ] ) {
210- outputChannel . appendLine ( `csolution error: ${ message } `) ;
209+ outputChannel . append ( `\ncsolution error: ${ message } `) ;
211210 }
212211 for ( const message of messages ?. warnings ?? [ ] ) {
213- outputChannel . appendLine ( `csolution warning: ${ message } `) ;
212+ outputChannel . append ( `\ncsolution warning: ${ message } `) ;
214213 }
215214 }
216215
217216 private async downloadMissingPacks ( packs : string [ ] ) : Promise < void > {
218217 // call cpackget to download missing packs
219218 const outputChannel = this . outputChannelProvider . getOrCreate ( manifest . CMSIS_SOLUTION_OUTPUT_CHANNEL ) ;
219+ outputChannel . append ( 'Downloading missing packs...\n' ) ;
220220 for ( const pack of packs ) {
221221 const args = [ 'add' , pack , '--force-reinstall' , '--agree-embedded-license' , '--no-dependencies' ] ;
222222 await this . cmsisToolboxManager . runCmsisTool ( 'cpackget' , args , line => outputChannel . appendLine ( line . trimEnd ( ) ) , undefined , undefined , true ) ;
@@ -227,13 +227,13 @@ export class SolutionConverterImpl implements SolutionConverter {
227227 const outputChannel = this . outputChannelProvider . getOrCreate ( manifest . CMSIS_SOLUTION_OUTPUT_CHANNEL ) ;
228228 this . solutionManager . getCsolution ( ) ?. setVariablesConfigurations ( undefined ) ;
229229 // rpc method: DiscoverLayers
230+ outputChannel . append ( 'Discover Layers... ' ) ;
230231 const result = await this . cmsisToolboxManager . runCsolutionRpc (
231232 'DiscoverLayers' ,
232233 {
233234 solution : this . data ?. solutionPath ?? '' ,
234235 activeTarget : this . data ?. targetSet ?? '' ,
235- } ,
236- line => outputChannel . appendLine ( line )
236+ }
237237 ) as rpc . DiscoverLayersInfo ;
238238 this . solutionManager . getCsolution ( ) ?. setVariablesConfigurations ( result . configurations ) ;
239239 return result . success ;
0 commit comments