From a2705967e76a42230efb1323571d0bda10f8ee3a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 16 Sep 2020 14:34:56 +0300 Subject: [PATCH] Added a new setting ``platformio-ide.autoPreloadEnvTasks`` to enable automatic preloading of the project environment tasks // Resolve #2004 --- CHANGELOG.md | 1 + package.json | 5 +++++ src/tasks/project.js | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bbfaf9..0fa9852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2.1.0 (2020-09-16) +* Added a new setting ``platformio-ide.autoPreloadEnvTasks`` to enable automatic preloading of the project environment tasks (issue [#2004](https://github.com/platformio/platformio-vscode-ide/issues/2004)) * Renamed "PIO Remote" group of tasks to "Remote Development" * Updated PlatformIO Core installer to [v0.3.5](https://github.com/platformio/platformio-core-installer/releases/tag/v0.3.5) diff --git a/package.json b/package.json index 5e29c18..6cec5fb 100644 --- a/package.json +++ b/package.json @@ -546,6 +546,11 @@ "default": null, "description": "The build task (label) used for the `Build` button in the bottom toolbar and for key bindings. The default is `PlatformIO: Build`." }, + "platformio-ide.autoPreloadEnvTasks": { + "type": "boolean", + "default": false, + "description": "Automatically preload ALL project environment tasks" + }, "platformio-ide.customPATH": { "type": [ "string", diff --git a/src/tasks/project.js b/src/tasks/project.js index ff3614f..23a9535 100644 --- a/src/tasks/project.js +++ b/src/tasks/project.js @@ -71,6 +71,12 @@ export default class ProjectTaskManager { }) ); + if (extension.getSetting('autoPreloadEnvTasks')) { + for (const item of envs) { + await this.onDidLoadEnvTasks(item.name); + } + } + this.addProjectConfigWatcher(); this.controlDeviceMonitorTasks(); this.registerTaskBasedCommands();