@@ -26,6 +26,7 @@ import { makeCompilerParserContext } from "./intellisense";
26
26
import { ProgrammerManager } from "./programmerManager" ;
27
27
28
28
export enum BuildMode {
29
+ Verify = "Verifying" ,
29
30
Upload = "Uploading" ,
30
31
UploadProgrammer = "Uploading (programmer)" ,
31
32
} ;
@@ -271,7 +272,7 @@ export class ArduinoApp {
271
272
} ) ;
272
273
}
273
274
274
- public async verify ( output : string = "" ) {
275
+ public async verify ( buildMode : BuildMode , output : string = "" ) {
275
276
const dc = DeviceContext . getInstance ( ) ;
276
277
const args : string [ ] = [ ] ;
277
278
const boardDescriptor = this . getBoardBuildString ( ) ;
@@ -291,10 +292,12 @@ export class ArduinoApp {
291
292
await this . getMainSketch ( dc ) ;
292
293
}
293
294
294
- if ( ! this . useArduinoCli ( ) ) {
295
- args . push ( "--verify" ) ;
296
- } else {
297
- args . push ( "compile" , "-b" , boardDescriptor ) ;
295
+ if ( buildMode === BuildMode . Verify ) {
296
+ if ( ! this . useArduinoCli ( ) ) {
297
+ args . push ( "--verify" ) ;
298
+ } else {
299
+ args . push ( "compile" , "-b" , boardDescriptor ) ;
300
+ }
298
301
}
299
302
300
303
const verbose = VscodeSettings . getInstance ( ) . logLevel === "verbose" ;
@@ -305,7 +308,7 @@ export class ArduinoApp {
305
308
await vscode . workspace . saveAll ( false ) ;
306
309
307
310
arduinoChannel . show ( ) ;
308
- arduinoChannel . start ( `Verify sketch - ${ dc . sketch } ` ) ;
311
+ arduinoChannel . start ( `${ buildMode } sketch ' ${ dc . sketch } ' ` ) ;
309
312
310
313
if ( ! await this . runPreBuildCommand ( dc ) ) {
311
314
return false ;
@@ -350,16 +353,16 @@ export class ArduinoApp {
350
353
compilerParserContext . callback ,
351
354
) . then ( async ( ) => {
352
355
await cleanup ( ) ;
353
- arduinoChannel . end ( `Finished verifying sketch - ${ dc . sketch } ${ os . EOL } ` ) ;
356
+ arduinoChannel . end ( `${ buildMode } sketch ' ${ dc . sketch } ' ${ os . EOL } ` ) ;
354
357
success = true ;
355
358
} , async ( reason ) => {
356
359
await cleanup ( ) ;
357
360
const msg = reason . code ?
358
- `Exit with code=${ reason . code } ${ os . EOL } ` :
361
+ `Exit with code=${ reason . code } ` :
359
362
reason . message ?
360
363
reason . message :
361
364
JSON . stringify ( reason ) ;
362
- arduinoChannel . error ( msg ) ;
365
+ arduinoChannel . error ( ` ${ buildMode } sketch ' ${ dc . sketch } ': ${ msg } ${ os . EOL } ` ) ;
363
366
} ) ;
364
367
365
368
if ( compilerParserContext . conclude ) {
0 commit comments