From 37c18a0c744f6a6540bbb1dd759ad72cf656f7f1 Mon Sep 17 00:00:00 2001 From: rferrese Date: Sat, 20 Jun 2020 16:13:34 -0700 Subject: [PATCH 1/5] Add clear output on build option --- README.md | 1 + package.json | 7 ++++++- src/arduino/arduino.ts | 9 +++++++++ src/arduino/vscodeSettings.ts | 6 ++++++ src/common/outputChannel.ts | 4 ++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b7af0fa..fdbcd38f 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ This extension provides several commands in the Command Palette (F1 o | `arduino.commandPath` | Path to an executable (or script) relative to `arduino.path`. The default value is `arduino_debug.exe` for windows,`Contents/MacOS/Arduino` for Mac and `arduino` for Linux, You also can use a custom launch script to run Arduino by modifying this setting. (Requires a restart after change) Example: `run-arduino.bat` for Windows, `Contents/MacOS/run-arduino.sh` for Mac and `bin/run-arduino.sh` for Linux. | | `arduino.additionalUrls` | Additional Boards Manager URLs for 3rd party packages. You can have multiple URLs in one string with a comma(`,`) as separator, or have a string array. The default value is empty. | | `arduino.logLevel` | CLI output log level. Could be info or verbose. The default value is `"info"`. | +| `arduino.clearOutputOnBuild` | Clear the output logs before uploading or verifying | | `arduino.allowPDEFiletype` | Allow the VSCode Arduino extension to open .pde files from pre-1.0.0 versions of Ardiuno. Note that this will break Processing code. Default value is `false`. | | `arduino.enableUSBDetection` | Enable/disable USB detection from the VSCode Arduino extension. The default value is `true`. When your device is plugged in to your computer, it will pop up a message "`Detected board ****, Would you like to switch to this board type`". After clicking the `Yes` button, it will automatically detect which serial port (COM) is connected a USB device. If your device does not support this feature, please provide us with the PID/VID of your device; the code format is defined in `misc/usbmapping.json`.To learn more about how to list the vid/pid, use the following tools: https://github.com/EmergingTechnologyAdvisors/node-serialport `npm install -g serialport` `serialport-list -f jsonline`| | `arduino.disableTestingOpen` | Enable/disable automatic sending of a test message to the serial port for checking the open status. The default value is `false` (a test message will be sent). | diff --git a/package.json b/package.json index 968d16d3..45fe67e2 100644 --- a/package.json +++ b/package.json @@ -467,6 +467,11 @@ "verbose" ] }, + "arduino.clearOutputOnBuild": { + "type": "boolean", + "default": false, + "description": "Clear the output logs before uploading or verifying" + }, "arduino.openPDEFiletype": { "type": "boolean", "default": false, @@ -587,4 +592,4 @@ "winreg": "^1.2.3", "winston": "^2.3.1" } -} +} \ No newline at end of file diff --git a/src/arduino/arduino.ts b/src/arduino/arduino.ts index 73619a7b..d111dc47 100644 --- a/src/arduino/arduino.ts +++ b/src/arduino/arduino.ts @@ -120,6 +120,9 @@ export class ArduinoApp { } arduinoChannel.show(); + if (VscodeSettings.getInstance().clearOutputOnBuild) { + arduinoChannel.clear(); + } arduinoChannel.start(`Upload sketch - ${dc.sketch}`); const serialMonitor = SerialMonitor.getInstance(); @@ -205,6 +208,9 @@ export class ArduinoApp { } arduinoChannel.show(); + if (VscodeSettings.getInstance().clearOutputOnBuild) { + arduinoChannel.clear(); + } arduinoChannel.start(`Upload sketch - ${dc.sketch}`); const serialMonitor = SerialMonitor.getInstance(); @@ -262,6 +268,9 @@ export class ArduinoApp { await vscode.workspace.saveAll(false); + if (VscodeSettings.getInstance().clearOutputOnBuild) { + arduinoChannel.clear(); + } arduinoChannel.start(`Verify sketch - ${dc.sketch}`); if (dc.prebuild) { diff --git a/src/arduino/vscodeSettings.ts b/src/arduino/vscodeSettings.ts index f66e268b..547a5152 100644 --- a/src/arduino/vscodeSettings.ts +++ b/src/arduino/vscodeSettings.ts @@ -8,6 +8,7 @@ const configKeys = { ARDUINO_COMMAND_PATH: "arduino.commandPath", ADDITIONAL_URLS: "arduino.additionalUrls", LOG_LEVEL: "arduino.logLevel", + CLEAR_OUTPUT_ON_START: "arduino.clearOutputOnBuild", AUTO_UPDATE_INDEX_FILES: "arduino.autoUpdateIndexFiles", ALLOW_PDE_FILETYPE: "arduino.allowPDEFiletype", ENABLE_USB_DETECTION: "arduino.enableUSBDetection", @@ -22,6 +23,7 @@ export interface IVscodeSettings { commandPath: string; additionalUrls: string | string[]; logLevel: string; + clearOutputOnBuild: boolean; allowPDEFiletype: boolean; enableUSBDetection: boolean; disableTestingOpen: boolean; @@ -59,6 +61,10 @@ export class VscodeSettings implements IVscodeSettings { return this.getConfigValue(configKeys.LOG_LEVEL) || "info"; } + public get clearOutputOnBuild(): boolean { + return this.getConfigValue(configKeys.CLEAR_OUTPUT_ON_START); + } + public get allowPDEFiletype(): boolean { return this.getConfigValue(configKeys.ALLOW_PDE_FILETYPE); } diff --git a/src/common/outputChannel.ts b/src/common/outputChannel.ts index cb0db494..b27c5587 100644 --- a/src/common/outputChannel.ts +++ b/src/common/outputChannel.ts @@ -33,4 +33,8 @@ export const arduinoChannel = { hide() { this.channel.hide(); }, + + clear() { + this.channel.clear(); + } }; From 4ab7b0b16c34160570ade96125c1af2a7537ca4b Mon Sep 17 00:00:00 2001 From: rferrese Date: Sat, 20 Jun 2020 16:18:03 -0700 Subject: [PATCH 2/5] Add period and newline --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 116c050e..942b8c03 100644 --- a/package.json +++ b/package.json @@ -470,7 +470,7 @@ "arduino.clearOutputOnBuild": { "type": "boolean", "default": false, - "description": "Clear the output logs before uploading or verifying" + "description": "Clear the output logs before uploading or verifying." }, "arduino.openPDEFiletype": { "type": "boolean", @@ -592,4 +592,4 @@ "winreg": "^1.2.3", "winston": "^2.3.1" } -} \ No newline at end of file +} From cb69ae14d79ebb23a76eaaacd3649f1d858c2b79 Mon Sep 17 00:00:00 2001 From: rferrese Date: Sat, 20 Jun 2020 16:18:43 -0700 Subject: [PATCH 3/5] Add period to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22083a0d..410fa7e8 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ This extension provides several commands in the Command Palette (F1 o | `arduino.commandPath` | Path to an executable (or script) relative to `arduino.path`. The default value is `arduino_debug.exe` for windows,`Contents/MacOS/Arduino` for Mac and `arduino` for Linux, You also can use a custom launch script to run Arduino by modifying this setting. (Requires a restart after change) Example: `run-arduino.bat` for Windows, `Contents/MacOS/run-arduino.sh` for Mac and `bin/run-arduino.sh` for Linux. | | `arduino.additionalUrls` | Additional Boards Manager URLs for 3rd party packages. You can have multiple URLs in one string with a comma(`,`) as separator, or have a string array. The default value is empty. | | `arduino.logLevel` | CLI output log level. Could be info or verbose. The default value is `"info"`. | -| `arduino.clearOutputOnBuild` | Clear the output logs before uploading or verifying | +| `arduino.clearOutputOnBuild` | Clear the output logs before uploading or verifying. | | `arduino.allowPDEFiletype` | Allow the VSCode Arduino extension to open .pde files from pre-1.0.0 versions of Ardiuno. Note that this will break Processing code. Default value is `false`. | | `arduino.enableUSBDetection` | Enable/disable USB detection from the VSCode Arduino extension. The default value is `true`. When your device is plugged in to your computer, it will pop up a message "`Detected board ****, Would you like to switch to this board type`". After clicking the `Yes` button, it will automatically detect which serial port (COM) is connected a USB device. If your device does not support this feature, please provide us with the PID/VID of your device; the code format is defined in `misc/usbmapping.json`.To learn more about how to list the vid/pid, use the following tools: https://github.com/EmergingTechnologyAdvisors/node-serialport `npm install -g serialport` `serialport-list -f jsonline`| | `arduino.disableTestingOpen` | Enable/disable automatic sending of a test message to the serial port for checking the open status. The default value is `false` (a test message will be sent). | From dbcb13ba8c444c61b203dfe1cb8ab961bb781e47 Mon Sep 17 00:00:00 2001 From: rferrese Date: Sun, 21 Jun 2020 12:02:59 -0700 Subject: [PATCH 4/5] Add trailing comma --- src/common/outputChannel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/outputChannel.ts b/src/common/outputChannel.ts index b27c5587..2399c551 100644 --- a/src/common/outputChannel.ts +++ b/src/common/outputChannel.ts @@ -36,5 +36,5 @@ export const arduinoChannel = { clear() { this.channel.clear(); - } + }, }; From 9cb1b39a0df3ed6b917472b936b267c49fbe3623 Mon Sep 17 00:00:00 2001 From: Ben McMorran Date: Mon, 10 Jan 2022 14:33:18 -0800 Subject: [PATCH 5/5] Add default value to README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6ac6e582..88c23c3e 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,8 @@ This extension provides several commands in the Command Palette (F1 o | `arduino.commandPath` | Path to an executable (or script) relative to `arduino.path`. The default value is `arduino_debug.exe` for Windows, `Contents/MacOS/Arduino` for Mac and `arduino` for Linux, You also can use a custom launch script to run Arduino by modifying this setting. (Requires a restart after change) Example: `run-arduino.bat` for Windows, `Contents/MacOS/run-arduino.sh` for Mac and `bin/run-arduino.sh` for Linux. | | `arduino.additionalUrls` | Additional Boards Manager URLs for 3rd party packages. You can have multiple URLs in one string with a comma(`,`) as separator, or have a string array. The default value is empty. | | `arduino.logLevel` | CLI output log level. Could be info or verbose. The default value is `"info"`. | -| `arduino.clearOutputOnBuild` | Clear the output logs before uploading or verifying. | -| `arduino.allowPDEFiletype` | Allow the VSCode Arduino extension to open .pde files from pre-1.0.0 versions of Ardiuno. Note that this will break Processing code. Default value is `false`. | +| `arduino.clearOutputOnBuild` | Clear the output logs before uploading or verifying. Default value is `false`. | +| `arduino.allowPDEFiletype` | Allow the VSCode Arduino extension to open .pde files from pre-1.0.0 versions of Arduino. Note that this will break Processing code. Default value is `false`. | | `arduino.enableUSBDetection` | Enable/disable USB detection from the VSCode Arduino extension. The default value is `true`. When your device is plugged in to your computer, it will pop up a message "`Detected board ****, Would you like to switch to this board type`". After clicking the `Yes` button, it will automatically detect which serial port (COM) is connected a USB device. If your device does not support this feature, please provide us with the PID/VID of your device; the code format is defined in `misc/usbmapping.json`.To learn more about how to list the vid/pid, use the following tools: https://github.com/EmergingTechnologyAdvisors/node-serialport `npm install -g serialport` `serialport-list -f jsonline`| | `arduino.disableTestingOpen` | Enable/disable automatic sending of a test message to the serial port for checking the open status. The default value is `false` (a test message will be sent). | | `arduino.skipHeaderProvider` | Enable/disable the extension providing completion items for headers. This functionality is included in newer versions of the C++ extension. The default value is `false`.|