Skip to content

Commit

Permalink
Merge branch 'release/v0.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Jan 16, 2018
2 parents b8e5baf + 122aebc commit b0d1051
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Notes

## 0.11.0 (2018-01-16)

* Added new option `activateOnlyOnPlatformIOProject` (activate extension only when PlatformIO-based project (with `platformio.ini`) is opened in workspace) (issue [#66](https://github.com/platformio/platformio-vscode-ide/issues/66))
* Changed minimum requirements for Python to 2.7.5+
* Handle correctly conda's virtual environment
* Don't update Terminal configuration with patched PATH environment for non-PlatformIO projects (issue [#64](https://github.com/platformio/platformio-vscode-ide/issues/64))
* Ignore Python interpreter from Cygwin environment (issue [#43](https://github.com/platformio/platformio-vscode-ide/issues/43))

## 0.10.0 (2018-01-11)

* Added PIO Remote & PIO Unit Testing buttons and commands
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "platformio-ide",
"version": "0.10.0",
"version": "0.11.0",
"preview": true,
"displayName": "PlatformIO IDE",
"description": "Official PlatformIO IDE for IoT, Arduino, ARM mbed, Espressif (ESP8266/ESP32), STM32, PIC32, nRF51/nRF52, FPGA, CMSIS, SPL, AVR, Samsung ARTIK, libOpenCM3",
Expand Down Expand Up @@ -203,6 +203,11 @@
"type": "boolean",
"default": true,
"description": "Update Terminal configuration with patched PATH environment"
},
"platformio-ide.activateOnlyOnPlatformIOProject": {
"type": "boolean",
"default": false,
"description": "Activate extension only when PlatformIO-based project (with `platformio.ini`) is opened in workspace"
}
}
}
Expand Down Expand Up @@ -230,7 +235,7 @@
"dependencies": {
"fs-plus": "^3.0.0",
"ini": "^1.3.4",
"platformio-node-helpers": "^0.3.2"
"platformio-node-helpers": "^0.3.4"
},
"extensionDependencies": [
"ms-vscode.cpptools",
Expand Down
18 changes: 14 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class PlatformIOVSCodeExtension {

async activate(context) {
this._context = context;
const hasPIOProject = this.workspaceHasPIOProject();

if (this.config.get('activateOnlyOnPlatformIOProject') && !hasPIOProject) {
return;
}

pioNodeHelpers.misc.patchOSEnviron({
caller: 'vscode',
Expand All @@ -40,9 +45,6 @@ class PlatformIOVSCodeExtension {
}
});

if (this.config.get('updateTerminalPathConfiguration')) {
this.pioTerm.updateEnvConfiguration();
}
this.registerCommands();

await this.startInstaller();
Expand All @@ -51,16 +53,24 @@ class PlatformIOVSCodeExtension {
vscode.commands.executeCommand('platformio-ide.showHome');
}

if (!vscode.workspace.rootPath || !isPIOProject(vscode.workspace.rootPath)) {
if (!hasPIOProject) {
this.initStatusBar(['PlatformIO: Home']);
return;
}

if (this.config.get('updateTerminalPathConfiguration')) {
this.pioTerm.updateEnvConfiguration();
}

this.initTasksProvider();
this.initStatusBar();
this.initProjectIndexer();
}

workspaceHasPIOProject() {
return vscode.workspace.rootPath && isPIOProject(vscode.workspace.rootPath);
}

startInstaller() {
return vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
Expand Down

0 comments on commit b0d1051

Please sign in to comment.