From 9373a0bcaf7f8b63906ec0d399e2fc19c6144615 Mon Sep 17 00:00:00 2001 From: Dave Simpson <45690499+davegarthsimpson@users.noreply.github.com> Date: Tue, 26 Jul 2022 14:05:12 +0200 Subject: [PATCH] #374: ensure compile verbose pref is included on upload (#1237) * ensure compile verbose pref is included on upload * better verbose typings Signed-off-by: Akos Kitta Co-authored-by: Akos Kitta --- .../src/browser/contributions/upload-sketch.ts | 5 ++++- arduino-ide-extension/src/common/protocol/core-service.ts | 3 ++- arduino-ide-extension/src/node/core-service-impl.ts | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arduino-ide-extension/src/browser/contributions/upload-sketch.ts b/arduino-ide-extension/src/browser/contributions/upload-sketch.ts index 8da2b618d..c17143bbf 100644 --- a/arduino-ide-extension/src/browser/contributions/upload-sketch.ts +++ b/arduino-ide-extension/src/browser/contributions/upload-sketch.ts @@ -214,9 +214,10 @@ export class UploadSketch extends CoreServiceContribution { fqbn, { selectedProgrammer }, verify, - verbose, + uploadVerbose, sourceOverride, optimizeForDebug, + compileVerbose, ] = await Promise.all([ this.boardsDataStore.appendConfigToFqbn( boardsConfig.selectedBoard?.fqbn @@ -228,8 +229,10 @@ export class UploadSketch extends CoreServiceContribution { this.commandService.executeCommand( 'arduino-is-optimize-for-debug' ), + this.preferences.get('arduino.compile.verbose'), ]); + const verbose = { compile: compileVerbose, upload: uploadVerbose }; const board = { ...boardsConfig.selectedBoard, name: boardsConfig.selectedBoard?.name || '', diff --git a/arduino-ide-extension/src/common/protocol/core-service.ts b/arduino-ide-extension/src/common/protocol/core-service.ts index f720a7d61..1ac6a2913 100644 --- a/arduino-ide-extension/src/common/protocol/core-service.ts +++ b/arduino-ide-extension/src/common/protocol/core-service.ts @@ -84,11 +84,12 @@ export namespace CoreService { } export namespace Upload { - export interface Options extends Compile.Options { + export interface Options extends Omit { readonly port?: Port; readonly programmer?: Programmer | undefined; readonly verify: boolean; readonly userFields: BoardUserField[]; + readonly verbose: { compile: boolean; upload: boolean }; } } diff --git a/arduino-ide-extension/src/node/core-service-impl.ts b/arduino-ide-extension/src/node/core-service-impl.ts index afe7f2099..a10b829da 100644 --- a/arduino-ide-extension/src/node/core-service-impl.ts +++ b/arduino-ide-extension/src/node/core-service-impl.ts @@ -200,7 +200,11 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { ) => ApplicationError, task: string ): Promise { - await this.compile(Object.assign(options, { exportBinaries: false })); + await this.compile({ + ...options, + verbose: options.verbose.compile, + exportBinaries: false, + }); const coreClient = await this.coreClient; const { client, instance } = coreClient; @@ -262,7 +266,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService { if (programmer) { request.setProgrammer(programmer.id); } - request.setVerbose(options.verbose); + request.setVerbose(options.verbose.upload); request.setVerify(options.verify); options.userFields.forEach((e) => {