From 7c2007317743117444774d8124b8b4f8d42deb09 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Jul 2019 16:42:24 +0300 Subject: [PATCH 1/4] Fix linter issues --- src/home.js | 2 +- src/main.js | 11 ++++------- src/state-storage.js | 6 +----- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/home.js b/src/home.js index b87b8e1..f25e2f2 100644 --- a/src/home.js +++ b/src/home.js @@ -32,7 +32,7 @@ export default class PIOHome { try { if (this._currentPanel) { if (this._lastStartUrl !== startUrl) { - this._currentPanel.webview.html = await this.getWebviewContent(startUrl);; + this._currentPanel.webview.html = await this.getWebviewContent(startUrl); } return this._currentPanel.reveal(column); } diff --git a/src/main.js b/src/main.js index 3a73a39..05e3fd8 100644 --- a/src/main.js +++ b/src/main.js @@ -112,20 +112,17 @@ class PlatformIOVSCodeExtension { && item.id !== 'platformio.platformio-ide' && item.isActive ); - if (!ext || !ext.exports || !ext.exports.hasOwnProperty('settings')) { - return; - } - return ext.exports.settings; + return (ext && ext.exports) ? ext.exports.settings : undefined; } getEnterpriseSetting(id, defaultValue = undefined) { if (!this._enterpriseSettings) { this._enterpriseSettings = this.loadEnterpriseSettings(); } - if (!this._enterpriseSettings || !this._enterpriseSettings.hasOwnProperty(id)) { - return defaultValue; + if (this._enterpriseSettings && id in this._enterpriseSettings) { + return this._enterpriseSettings[id]; } - return this._enterpriseSettings[id]; + return defaultValue; } patchOSEnviron() { diff --git a/src/state-storage.js b/src/state-storage.js index 2faa8ba..e1bada5 100644 --- a/src/state-storage.js +++ b/src/state-storage.js @@ -23,11 +23,7 @@ export default class StateStorage { } getValue(key) { - const data = this._loadState(); - if (data && data.hasOwnProperty(key)) { - return data[key]; - } - return undefined; + return (this._loadState() || {})[key]; } setValue(key, value) { From b4236752c1195155cc877bb81a09287248607bd0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 11 Aug 2019 14:30:18 +0300 Subject: [PATCH 2/4] Show multi-environment tasks when more than one env is declared --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed385b7..0afd45b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Release Notes +## 1.8.2 (2019-08-??) + +- Show multi-environment tasks when more than one project `env` is declared +- + ## 1.8.1 (2019-07-23) - Added new command "Open PlatformIO Core CLI" diff --git a/package.json b/package.json index fbc62fb..d95a09c 100644 --- a/package.json +++ b/package.json @@ -604,7 +604,7 @@ }, "dependencies": { "fs-plus": "^3.1.1", - "platformio-node-helpers": "^5.0.2", + "platformio-node-helpers": "^5.0.3", "platformio-vscode-debug": "^1.2.8" }, "extensionDependencies": [ From cb5b8b6032019c8100e36f07e386e4b972fa5dcc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 11 Aug 2019 14:33:52 +0300 Subject: [PATCH 3/4] Temporary workaround for the broken Tasks API in the latest VSCode 1.37 // Resolve #957 --- CHANGELOG.md | 2 +- src/tasks.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0afd45b..f469d07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.8.2 (2019-08-??) - Show multi-environment tasks when more than one project `env` is declared -- +- Temporary workaround for the broken Tasks API in the latest VSCode 1.37 (issue [#957](https://github.com/platformio/platformio-vscode-ide/issues/957)) ## 1.8.1 (2019-07-23) diff --git a/src/tasks.js b/src/tasks.js index d556c0e..4673be6 100644 --- a/src/tasks.js +++ b/src/tasks.js @@ -65,7 +65,7 @@ export default class TaskManager { vscode.workspace.getWorkspaceFolder(vscode.Uri.file(this._projectDir)), projectTask.title, TaskManager.type, - new vscode.ProcessExecution(IS_WINDOWS ? 'platformio.exe' : 'platformio', projectTask.args, { + new vscode.ShellExecution(IS_WINDOWS ? 'platformio.exe' : 'platformio', projectTask.args, { cwd: this._projectDir, env: process.env }), From b197547f55110bb5d7a0182fa51818ccb99bd247 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 11 Aug 2019 14:35:11 +0300 Subject: [PATCH 4/4] Bump version to 1.8.2 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f469d07..9d5577a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes -## 1.8.2 (2019-08-??) +## 1.8.2 (2019-08-11) - Show multi-environment tasks when more than one project `env` is declared - Temporary workaround for the broken Tasks API in the latest VSCode 1.37 (issue [#957](https://github.com/platformio/platformio-vscode-ide/issues/957)) diff --git a/package.json b/package.json index d95a09c..686fc93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-ide", - "version": "1.8.1", + "version": "1.8.2", "publisher": "platformio", "engines": { "vscode": "^1.24.0"