From a97c085a8b29ab02eff98787fce0718be14e685f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 9 Mar 2021 23:02:58 +0200 Subject: [PATCH 1/9] Minimal supported Python version is 3.6 --- src/installer/python-prompt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/python-prompt.js b/src/installer/python-prompt.js index 3e0a496..b657a09 100644 --- a/src/installer/python-prompt.js +++ b/src/installer/python-prompt.js @@ -16,7 +16,7 @@ export default class PythonPrompt { async prompt() { const selectedItem = await vscode.window.showInformationMessage( - 'PlatformIO: Can not find working Python 2.7 or 3.5+ Interpreter. Please install the latest Python 3 and restart VSCode', + 'PlatformIO: Can not find working Python 3.6+ Interpreter. Please install the latest Python 3 and restart VSCode', { title: 'Install Python', isCloseAffordance: false }, { title: 'I have Python', isCloseAffordance: false }, { title: 'Try again', isCloseAffordance: false }, From 0a5ae4ed830bf37fe58f2ea66ec66cfb3e632678 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 22 Mar 2021 23:00:14 +0200 Subject: [PATCH 2/9] Automatically activate project environment opened via PIO Home > New Project / Open Project // Resolve #2414 --- CHANGELOG.md | 6 +++++- src/home.js | 7 +++++++ src/main.js | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 811fa4d..6c60810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Release Notes -## 2.3.0 (2021-??-??) +## 2.3.1 (2021-??-??) + +- Automatically activate project environment opened via PIO Home > New Project / Open Project (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) + +## 2.3.0 (2021-03-03) **Requires PlatformIO Core 5.1 or above** diff --git a/src/home.js b/src/home.js index fbd4dda..dd4d246 100644 --- a/src/home.js +++ b/src/home.js @@ -97,6 +97,13 @@ export default class PIOHome { port: extension.getSetting('pioHomeServerHttpPort'), onIDECommand: async (command, params) => { if (command === 'open_project') { + if (extension.projectObservable) { + extension.projectObservable.saveProjectStateItem( + vscode.Uri.file(params).path, + 'activeEnv', + undefined + ); + } this.disposePanel(); if (vscode.workspace.workspaceFolders) { vscode.workspace.updateWorkspaceFolders( diff --git a/src/main.js b/src/main.js index 9fcfe1b..851e72c 100644 --- a/src/main.js +++ b/src/main.js @@ -26,6 +26,7 @@ class PlatformIOVSCodeExtension { this.context = undefined; this.pioTerm = undefined; this.pioHome = undefined; + this.projectObservable = undefined; this.subscriptions = []; this._enterpriseSettings = undefined; @@ -84,7 +85,8 @@ class PlatformIOVSCodeExtension { this.initToolbar({ ignoreCommands: this.getEnterpriseSetting('ignoreToolbarCommands'), }); - this.subscriptions.push(new ProjectObservable()); + this.projectObservable = new ProjectObservable(); + this.subscriptions.push(this.projectObservable); this.startPIOHome(); From a81a0978f2769cd69b3a3ff135fbb0c53c4b5bed Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 22 Mar 2021 23:08:26 +0200 Subject: [PATCH 3/9] Do not show "Default" environment when a project does not have any build environments // Resolve #2450 --- CHANGELOG.md | 3 ++- src/project/observable.js | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c60810..81874b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 2.3.1 (2021-??-??) -- Automatically activate project environment opened via PIO Home > New Project / Open Project (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) +- Automatically activate project environment opened via "PIO Home > New Project / Open Project" (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) +- Do not show "Default" environment when a project does not have any build environments (issue [#2450](https://github.com/platformio/platformio-vscode-ide/issues/2450)) ## 2.3.0 (2021-03-03) diff --git a/src/project/observable.js b/src/project/observable.js index 9f83791..ef98dd5 100644 --- a/src/project/observable.js +++ b/src/project/observable.js @@ -230,21 +230,25 @@ export default class ProjectObservable { async pickProjectEnv() { const items = []; for (const projectDir of ProjectObservable.getPIOProjectDirs()) { - const shortPrpjectDir = `${path.basename( + const observer = this._pool.getObserver(projectDir); + const envs = await observer.getProjectEnvs(); + if (!envs || !envs.length) { + continue; + } + const shortProjectDir = `${path.basename( path.dirname(projectDir) )}/${path.basename(projectDir)}`; items.push({ projectDir, label: 'Default', - description: `$(folder) ${shortPrpjectDir} ("default_envs" from "platformio.ini")`, + description: `$(folder) ${shortProjectDir} ("default_envs" from "platformio.ini")`, }); - const observer = this._pool.getObserver(projectDir); items.push( - ...(await observer.getProjectEnvs()).map((item) => ({ + ...envs.map((item) => ({ projectDir, envName: item.name, label: `env:${item.name}`, - description: `$(folder) ${shortPrpjectDir}`, + description: `$(folder) ${shortProjectDir}`, })) ); } From 61145aa468830aa3bc5e9b236b194486053d2f4e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Mar 2021 13:08:14 +0200 Subject: [PATCH 4/9] Added a new setting platformio-ide.autoOpenPlatformIOIniFile to control an automatic opening of the platformio.ini file from a project when no other editors are opened // Resolve #2419 --- CHANGELOG.md | 67 ++++++++++++++++++++------------------- package.json | 5 +++ src/project/observable.js | 5 ++- 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81874b7..edde73c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2.3.1 (2021-??-??) +- Added a new setting ``platformio-ide.autoOpenPlatformIOIniFile`` to control an automatic opening of the `platformio.ini` file from a project when no other editors are opened (issue [#2419](https://github.com/platformio/platformio-vscode-ide/issues/2419)) - Automatically activate project environment opened via "PIO Home > New Project / Open Project" (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) - Do not show "Default" environment when a project does not have any build environments (issue [#2450](https://github.com/platformio/platformio-vscode-ide/issues/2450)) @@ -9,18 +10,18 @@ **Requires PlatformIO Core 5.1 or above** -* Project management: - - Show active project in the status bar (issue [#2276](https://github.com/platformio/platformio-vscode-ide/issues/2276)) - - Automatically switch to the latest project on restart (issue [#2365](https://github.com/platformio/platformio-vscode-ide/issues/2365)) - - Automatically restore the latest project environment (issue [#2344](https://github.com/platformio/platformio-vscode-ide/issues/2344)) -* Allowed passing custom base URL of the Python Package Index using new `customPyPiIndexUrl` setting -* Open ["platformio.ini" configuration file](https://docs.platformio.org/page/projectconf/index.html) from newly added project (if there are no other active editors) (issue [#2263](https://github.com/platformio/platformio-vscode-ide/issues/2263)) -* Updated PlatformIO Core installer to v1.0.0 ([release notes](https://github.com/platformio/platformio-core-installer/releases/tag/v1.0.0)) -* Added protection for infinite IntelliSense index rebuilding (issue [#2363](https://github.com/platformio/platformio-vscode-ide/issues/2363)) -* Added "OpenAPI (Swagger) Editor" extension to the conflicted list (issue [#2324](https://github.com/platformio/platformio-vscode-ide/issues/2324)) -* Fixed issues when the "Upload and Monitor" command didn't terminate the running task and didn't reopen a monitor with delay (issue [#2266](https://github.com/platformio/platformio-vscode-ide/issues/2266), issue [#2319](https://github.com/platformio/platformio-vscode-ide/issues/2319)) -* Fixed an issue with broken IntelliSense index rebuilding or tasks loading for big projects (issue [#2321](https://github.com/platformio/platformio-vscode-ide/issues/2321)) -* Fixed an issue when a debug breakpoint was not allowed for Assembly files +- Project management: + * Show active project in the status bar (issue [#2276](https://github.com/platformio/platformio-vscode-ide/issues/2276)) + * Automatically switch to the latest project on restart (issue [#2365](https://github.com/platformio/platformio-vscode-ide/issues/2365)) + * Automatically restore the latest project environment (issue [#2344](https://github.com/platformio/platformio-vscode-ide/issues/2344)) +- Allowed passing custom base URL of the Python Package Index using new `customPyPiIndexUrl` setting +- Open ["platformio.ini" configuration file](https://docs.platformio.org/page/projectconf/index.html) from newly added project (if there are no other active editors) (issue [#2263](https://github.com/platformio/platformio-vscode-ide/issues/2263)) +- Updated PlatformIO Core installer to v1.0.0 ([release notes](https://github.com/platformio/platformio-core-installer/releases/tag/v1.0.0)) +- Added protection for infinite IntelliSense index rebuilding (issue [#2363](https://github.com/platformio/platformio-vscode-ide/issues/2363)) +- Added "OpenAPI (Swagger) Editor" extension to the conflicted list (issue [#2324](https://github.com/platformio/platformio-vscode-ide/issues/2324)) +- Fixed issues when the "Upload and Monitor" command didn't terminate the running task and didn't reopen a monitor with delay (issue [#2266](https://github.com/platformio/platformio-vscode-ide/issues/2266), issue [#2319](https://github.com/platformio/platformio-vscode-ide/issues/2319)) +- Fixed an issue with broken IntelliSense index rebuilding or tasks loading for big projects (issue [#2321](https://github.com/platformio/platformio-vscode-ide/issues/2321)) +- Fixed an issue when a debug breakpoint was not allowed for Assembly files ## 2.2.1 (2020-11-12) @@ -55,36 +56,36 @@ ## 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) +- 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) ## 2.0.1 (2020-09-10) -* Moved "Project Tasks" view back to "PlatformIO" activity (you can now drag it to any location) +- Moved "Project Tasks" view back to "PlatformIO" activity (you can now drag it to any location) ## 2.0.0 (2020-09-10) **Requires PlatformIO Core 5.0 or above** **Requires VSCode 1.44 or above** -* New PlatformIO Task Explorer - - Instant access to the Project Tasks within the VSCode Explorer - - Grouped tasks: Generic, Advanced, PIO Remote, Platform, Custom, etc. - - Support for PlatformIO dev-platform tasks (Program FPGA bitstream, Burn bootloader, Upload to FS, OTA Update, etc). The list of tasks depends on a particular dev-platform - - Access to [User Custom Targets](https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-targets) -* New Project Environment Switcher - - Switch between project environments declared in [platformio.ini](https://docs.platformio.org/en/latest/projectconf/index.html) project configuration file (issue [#544](https://github.com/platformio/platformio-vscode-ide/issues/544)) - - Activate IntelliSense service based on the current environment - - Automatically generate a debugging configuration for the active environment -* New PlatformIO IDE Installer - - Added progress information - - Switched to the cross-platform and portable [get-platformio.py](https://github.com/platformio/platformio-core-installer) installer script - - Use built-in portable Python 3 on Windows and macOS (it can be disabled with ``platformio-ide.useBuiltinPython`` setting) -* Added support for ``extends`` option in ``platformio.ini`` project configuration file (issue [#1371](https://github.com/platformio/platformio-vscode-ide/issues/1371)) -* Contribute PlatformIO Core CLI into VSCode's default Terminal -* Reduced startup time (PlatformIO Core verification process) -* Fixed a bug when hotkeys in PlatformIO Home did not work on macOS (issue [#606](https://github.com/platformio/platformio-vscode-ide/issues/606)) +- New PlatformIO Task Explorer + * Instant access to the Project Tasks within the VSCode Explorer + * Grouped tasks: Generic, Advanced, PIO Remote, Platform, Custom, etc. + * Support for PlatformIO dev-platform tasks (Program FPGA bitstream, Burn bootloader, Upload to FS, OTA Update, etc). The list of tasks depends on a particular dev-platform + * Access to [User Custom Targets](https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-targets) +- New Project Environment Switcher + * Switch between project environments declared in [platformio.ini](https://docs.platformio.org/en/latest/projectconf/index.html) project configuration file (issue [#544](https://github.com/platformio/platformio-vscode-ide/issues/544)) + * Activate IntelliSense service based on the current environment + * Automatically generate a debugging configuration for the active environment +- New PlatformIO IDE Installer + * Added progress information + * Switched to the cross-platform and portable [get-platformio.py](https://github.com/platformio/platformio-core-installer) installer script + * Use built-in portable Python 3 on Windows and macOS (it can be disabled with ``platformio-ide.useBuiltinPython`` setting) +- Added support for ``extends`` option in ``platformio.ini`` project configuration file (issue [#1371](https://github.com/platformio/platformio-vscode-ide/issues/1371)) +- Contribute PlatformIO Core CLI into VSCode's default Terminal +- Reduced startup time (PlatformIO Core verification process) +- Fixed a bug when hotkeys in PlatformIO Home did not work on macOS (issue [#606](https://github.com/platformio/platformio-vscode-ide/issues/606)) ## 1.10.0 (2019-11-20) diff --git a/package.json b/package.json index 806c8bf..5a5dbdb 100644 --- a/package.json +++ b/package.json @@ -517,6 +517,11 @@ "default": false, "description": "Activate the PlatformIO extension only when a PlatformIO-based project (with `platformio.ini`) is opened in the workspace" }, + "platformio-ide.autoOpenPlatformIOIniFile": { + "type": "boolean", + "default": true, + "description": "Automatically open the `platformio.ini` file from a project when no other editors are opened" + }, "platformio-ide.autoCloseSerialMonitor": { "type": "boolean", "default": true, diff --git a/src/project/observable.js b/src/project/observable.js index ef98dd5..27b2b1f 100644 --- a/src/project/observable.js +++ b/src/project/observable.js @@ -186,7 +186,10 @@ export default class ProjectObservable { this._taskManager = new ProjectTaskManager(projectDir, observer); // open "platformio.ini" if no visible editors - if (vscode.window.visibleTextEditors.length === 0) { + if ( + vscode.window.visibleTextEditors.length === 0 && + extension.getSetting('autoOpenPlatformIOIniFile') + ) { vscode.window.showTextDocument( vscode.Uri.file(path.join(projectDir, 'platformio.ini')) ); From 9f05c4d6d4f5ba6376d09df28601f8d225236e93 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Mar 2021 13:09:21 +0200 Subject: [PATCH 5/9] Update deps --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5a5dbdb..495aa24 100644 --- a/package.json +++ b/package.json @@ -611,19 +611,19 @@ "vscode:package": "webpack --mode production && vsce package" }, "devDependencies": { - "@babel/core": "~7.13.8", + "@babel/core": "~7.13.10", "@types/node": "~12", "@types/vscode": "~1.44.0", "babel-eslint": "~10.1.0", "babel-loader": "~8.2.2", "babel-plugin-transform-class-properties": "~6.24.1", "babel-preset-env": "~1.7.0", - "eslint": "~7.21.0", + "eslint": "~7.22.0", "eslint-import-resolver-webpack": "~0.13.0", "eslint-plugin-import": "~2.22.1", "prettier": "~2.2.1", - "vsce": "~1.85.1", - "webpack": "~5.24.2", + "vsce": "~1.87.0", + "webpack": "~5.27.2", "webpack-cli": "~4.5.0" }, "dependencies": { From 577e5216cd1caae0da70fe2bd4e8392cf26b2c31 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Mar 2021 17:52:29 +0200 Subject: [PATCH 6/9] Added a new setting platformio-ide.activateProjectOnTextEditorChange to enable automatic project activation depending on an active opened text editor // Resolve #2410 --- CHANGELOG.md | 1 + package.json | 5 +++ src/home.js | 2 +- src/project/observable.js | 88 +++++++++++++++++++++++++++++++-------- 4 files changed, 77 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edde73c..824c476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 2.3.1 (2021-??-??) - Added a new setting ``platformio-ide.autoOpenPlatformIOIniFile`` to control an automatic opening of the `platformio.ini` file from a project when no other editors are opened (issue [#2419](https://github.com/platformio/platformio-vscode-ide/issues/2419)) +- Added a new setting ``platformio-ide.activateProjectOnTextEditorChange`` to enable automatic project activation depending on an active opened text editor (issue [#2410](https://github.com/platformio/platformio-vscode-ide/issues/2410)) - Automatically activate project environment opened via "PIO Home > New Project / Open Project" (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) - Do not show "Default" environment when a project does not have any build environments (issue [#2450](https://github.com/platformio/platformio-vscode-ide/issues/2450)) diff --git a/package.json b/package.json index 495aa24..a0c8192 100644 --- a/package.json +++ b/package.json @@ -517,6 +517,11 @@ "default": false, "description": "Activate the PlatformIO extension only when a PlatformIO-based project (with `platformio.ini`) is opened in the workspace" }, + "platformio-ide.activateProjectOnTextEditorChange": { + "type": "boolean", + "default": false, + "description": "Automatically activate project depending on an active opened text editor" + }, "platformio-ide.autoOpenPlatformIOIniFile": { "type": "boolean", "default": true, diff --git a/src/home.js b/src/home.js index dd4d246..02f68ce 100644 --- a/src/home.js +++ b/src/home.js @@ -99,7 +99,7 @@ export default class PIOHome { if (command === 'open_project') { if (extension.projectObservable) { extension.projectObservable.saveProjectStateItem( - vscode.Uri.file(params).path, + vscode.Uri.file(params).fsPath, 'activeEnv', undefined ); diff --git a/src/project/observable.js b/src/project/observable.js index 27b2b1f..927f5d8 100644 --- a/src/project/observable.js +++ b/src/project/observable.js @@ -66,7 +66,15 @@ export default class ProjectObservable { this.subscriptions = [ this._pool, - // vscode.window.onDidChangeActiveTextEditor(() => this.switchToProject()), + vscode.window.onDidChangeActiveTextEditor(() => { + if (!extension.getSetting('activateProjectOnTextEditorChange')) { + return; + } + const projectDir = this.getActiveEditorProjectDir(); + if (projectDir) { + this.switchToProject(projectDir); + } + }), vscode.workspace.onDidChangeWorkspaceFolders(() => this.switchToProject(this.findActiveProjectDir()) ), @@ -105,6 +113,14 @@ export default class ProjectObservable { } findActiveProjectDir() { + let projectDir = undefined; + if (extension.getSetting('activateProjectOnTextEditorChange')) { + projectDir = this.getActiveEditorProjectDir(); + } + return projectDir || this.getSelectedProjectDir(); + } + + getSelectedProjectDir() { const pioProjectDirs = ProjectObservable.getPIOProjectDirs(); const currentActiveDir = this._pool.getActiveProjectDir(); if (pioProjectDirs.length < 1) { @@ -126,6 +142,27 @@ export default class ProjectObservable { return pioProjectDirs[0]; } + getActiveEditorProjectDir() { + const pioProjectDirs = ProjectObservable.getPIOProjectDirs(); + if (pioProjectDirs.length < 1) { + return undefined; + } + const editor = vscode.window.activeTextEditor; + if (!editor) { + return undefined; + } + const resource = editor.document.uri; + if (resource.scheme !== 'file') { + return undefined; + } + const folder = vscode.workspace.getWorkspaceFolder(resource); + if (!folder || !ProjectObservable.isPIOProjectSync(folder.uri.fsPath)) { + // outside workspace + return undefined; + } + return folder.uri.fsPath; + } + loadProjectStateItem(projectDir, name) { const data = (this._persistentState.getValue('projects') || {})[projectDir] || {}; return data[name]; @@ -169,30 +206,45 @@ export default class ProjectObservable { } this._sbEnvSwitcher.text = '$(root-folder) Loading...'; + let currentProjectDir = undefined; + let currentEnvName = undefined; + if (this._pool.getActiveObserver()) { + currentProjectDir = this._pool.getActiveObserver().projectDir; + currentEnvName = this._pool.getActiveObserver().getActiveEnvName(); + } + const observer = this._pool.getObserver(projectDir); - let envName = undefined; if ('envName' in options) { - envName = options.envName; + await observer.switchProjectEnv(options.envName); } else if (!observer.getActiveEnvName()) { - envName = this.loadProjectStateItem(projectDir, 'activeEnv'); - } - await observer.switchProjectEnv(envName); - this._pool.switch(projectDir); - - if (this._taskManager) { - this._taskManager.dispose(); - this._taskManager = undefined; + await observer.switchProjectEnv( + this.loadProjectStateItem(projectDir, 'activeEnv') + ); } - this._taskManager = new ProjectTaskManager(projectDir, observer); - // open "platformio.ini" if no visible editors + // ignore active project and & env if ( - vscode.window.visibleTextEditors.length === 0 && - extension.getSetting('autoOpenPlatformIOIniFile') + !currentProjectDir || + currentProjectDir !== projectDir || + currentEnvName !== observer.getActiveEnvName() ) { - vscode.window.showTextDocument( - vscode.Uri.file(path.join(projectDir, 'platformio.ini')) - ); + this._pool.switch(projectDir); + + if (this._taskManager) { + this._taskManager.dispose(); + this._taskManager = undefined; + } + this._taskManager = new ProjectTaskManager(projectDir, observer); + + // open "platformio.ini" if no visible editors + if ( + vscode.window.visibleTextEditors.length === 0 && + extension.getSetting('autoOpenPlatformIOIniFile') + ) { + vscode.window.showTextDocument( + vscode.Uri.file(path.join(projectDir, 'platformio.ini')) + ); + } } this.updateEnvSwitcher(); From adb0d567e45db69cfd1311928259a2a634053791 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Mar 2021 17:56:57 +0200 Subject: [PATCH 7/9] Update to the latest platformio-node-helpers --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/installer/python-prompt.js | 33 ++++++++++++++++++++------------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 824c476..6eb5fc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Added a new setting ``platformio-ide.activateProjectOnTextEditorChange`` to enable automatic project activation depending on an active opened text editor (issue [#2410](https://github.com/platformio/platformio-vscode-ide/issues/2410)) - Automatically activate project environment opened via "PIO Home > New Project / Open Project" (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) - Do not show "Default" environment when a project does not have any build environments (issue [#2450](https://github.com/platformio/platformio-vscode-ide/issues/2450)) +- PlatformIO IDE Installer + * Updated PlatformIO Core installer to v1.0.1 + * Rebuild project index only when the environment changes + * Fixed an issue "The 'path' argument must be of type string. Received undefined" ## 2.3.0 (2021-03-03) diff --git a/package.json b/package.json index a0c8192..4022eb9 100644 --- a/package.json +++ b/package.json @@ -633,7 +633,7 @@ }, "dependencies": { "fs-plus": "~3.1.1", - "platformio-node-helpers": "~9.1.1", + "platformio-node-helpers": "~9.1.2", "platformio-vscode-debug": "~1.3.0" }, "extensionDependencies": [ diff --git a/src/installer/python-prompt.js b/src/installer/python-prompt.js index b657a09..800ba91 100644 --- a/src/installer/python-prompt.js +++ b/src/installer/python-prompt.js @@ -23,6 +23,8 @@ export default class PythonPrompt { { title: 'Abort PlatformIO IDE Installation', isCloseAffordance: true } ); + let result = { status: this.STATUS_TRY_AGAIN }; + let pythonExecutable = undefined; switch (selectedItem ? selectedItem.title : undefined) { case 'Install Python': vscode.commands.executeCommand( @@ -31,21 +33,26 @@ export default class PythonPrompt { 'http://docs.platformio.org/page/faq.html#install-python-interpreter' ) ); - return { status: this.STATUS_TRY_AGAIN }; + break; case 'I have Python': - return { - status: this.STATUS_CUSTOMEXE, - pythonExecutable: await vscode.window.showInputBox({ - prompt: 'Please specify a full path to Python executable file', - placeHolder: 'Full path to python/python.exe', - validateInput: (value) => - !fs.isFileSync(value) ? 'Invalid path to Python Interpreter' : null, - }), - }; + pythonExecutable = await vscode.window.showInputBox({ + prompt: 'Please specify a full path to Python executable file', + placeHolder: 'Full path to python/python.exe', + validateInput: (value) => + !fs.isFileSync(value) ? 'Invalid path to Python Interpreter' : null, + }); + if (pythonExecutable) { + result = { + status: this.STATUS_CUSTOMEXE, + pythonExecutable, + }; + } + break; case 'Abort PlatformIO IDE Installation': - return { status: this.STATUS_ABORT }; - default: - return { status: this.STATUS_TRY_AGAIN }; + result = { status: this.STATUS_ABORT }; + break; } + + return result; } } From e8ffd94b251a12ae10964c8d22e201c4e29929c1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Mar 2021 18:18:56 +0200 Subject: [PATCH 8/9] Fixed an issue "Failed to load symbols from executable file" when debugging native/desktop application --- CHANGELOG.md | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb5fc9..37741db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added a new setting ``platformio-ide.activateProjectOnTextEditorChange`` to enable automatic project activation depending on an active opened text editor (issue [#2410](https://github.com/platformio/platformio-vscode-ide/issues/2410)) - Automatically activate project environment opened via "PIO Home > New Project / Open Project" (issue [#2414](https://github.com/platformio/platformio-vscode-ide/issues/2414)) - Do not show "Default" environment when a project does not have any build environments (issue [#2450](https://github.com/platformio/platformio-vscode-ide/issues/2450)) +- Fixed an issue "Failed to load symbols from executable file" when debugging native/desktop application - PlatformIO IDE Installer * Updated PlatformIO Core installer to v1.0.1 * Rebuild project index only when the environment changes diff --git a/package.json b/package.json index 4022eb9..94acc00 100644 --- a/package.json +++ b/package.json @@ -634,7 +634,7 @@ "dependencies": { "fs-plus": "~3.1.1", "platformio-node-helpers": "~9.1.2", - "platformio-vscode-debug": "~1.3.0" + "platformio-vscode-debug": "~1.3.1" }, "extensionDependencies": [ "ms-vscode.cpptools" From 17cf795b660b785cbef54e81fa32540c9bea0dc7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 23 Mar 2021 18:21:55 +0200 Subject: [PATCH 9/9] Bump version to 2.3.1 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37741db..e2c6b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes -## 2.3.1 (2021-??-??) +## 2.3.1 (2021-03-23) - Added a new setting ``platformio-ide.autoOpenPlatformIOIniFile`` to control an automatic opening of the `platformio.ini` file from a project when no other editors are opened (issue [#2419](https://github.com/platformio/platformio-vscode-ide/issues/2419)) - Added a new setting ``platformio-ide.activateProjectOnTextEditorChange`` to enable automatic project activation depending on an active opened text editor (issue [#2410](https://github.com/platformio/platformio-vscode-ide/issues/2410)) diff --git a/package.json b/package.json index 94acc00..fde984f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-ide", - "version": "2.3.0", + "version": "2.3.1", "publisher": "platformio", "engines": { "vscode": "^1.44.0"