Skip to content

Commit

Permalink
Merge branch 'release/v1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Sep 7, 2018
2 parents a3504f2 + f3f9070 commit c4b4757
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release Notes

## 1.1.1 (2018-09-07)

* Show "Project Tasks" before "Quick Access" in PlatformIO Activity Bar
* Reverted back "PlatformIO: Run Task..." button to PlatformIO Toolbar
* Improved performance of Project IntelliSense Indexer
* Fixed PlatformIO Core "ImportError: cannot import name _remove_dead_weakref" (issue [#142](https://github.com/platformio/platformio-vscode-ide/issues/142))
* Fixed PIO Home "[Errno 48] Address already in use" (issue [#313](https://github.com/platformio/platformio-vscode-ide/issues/313))
* Fixed issue when extension does not start after adding new project folder to workspace (issue [#319](https://github.com/platformio/platformio-vscode-ide/issues/319))

## 1.1.0 (2018-08-31)

* New "Debug" group to "Quick Access" view
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "platformio-ide",
"version": "1.1.0",
"version": "1.1.1",
"publisher": "platformio",
"engines": {
"vscode": "^1.24.0"
Expand Down Expand Up @@ -587,7 +587,7 @@
"devDependencies": {
"@types/node": "^8",
"babel-cli": "^6.24.1",
"babel-eslint": "^8.0.1",
"babel-eslint": "^9.0.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.0",
"esformatter": "^0.10.0",
Expand All @@ -598,7 +598,7 @@
},
"dependencies": {
"fs-plus": "^3.0.0",
"platformio-node-helpers": "^3.0.0",
"platformio-node-helpers": "^3.1.1",
"platformio-vscode-debug": "^1.2.0"
},
"extensionDependencies": [
Expand Down
8 changes: 2 additions & 6 deletions src/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default class PIOHome {
retainContextWhenHidden: true
}
);
this.subscriptions.push(panel.onDidDispose(this.onPanelDisposed.bind(this)));
panel.iconPath = vscode.Uri.file(path.join(extension.context.extensionPath, 'resources', 'platformio-mini-logo.png'));
panel.onDidDispose(this.onPanelDisposed.bind(this), null, this.subscriptions);
panel.webview.html = this.getLoadingContent();
try {
panel.webview.html = await this.getWebviewContent();
Expand Down Expand Up @@ -102,17 +102,13 @@ export default class PIOHome {
this._currentPanel = undefined;
}

shutdownServer() {
pioNodeHelpers.home.shutdownServer();
}

dispose() {
if (this._currentPanel) {
this._currentPanel.dispose();
this._currentPanel = undefined;
}
pioNodeHelpers.misc.disposeSubscriptions(this.subscriptions);
this.shutdownServer();
pioNodeHelpers.home.shutdownServer();
}

}
73 changes: 34 additions & 39 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,56 +29,47 @@ class PlatformIOVSCodeExtension {
this.subscriptions = [];
this.taskSubscriptions = [];

this._inited = false;
this._initedBefore = false;
this._enterpriseSettings = undefined;
}

activate(context) {
async activate(context) {
this.context = context;
this.pioHome = new PIOHome();
this.pioTerm = new PIOTerminal();

this.context.subscriptions.push(
this.pioHome,
this.pioTerm,
vscode.workspace.onDidChangeWorkspaceFolders(this.reinit.bind(this)),
vscode.workspace.onDidChangeConfiguration(() => this.reinit(true))
this.pioTerm
);

this.reinit();
}

async reinit(force) {
const hasPIOProject = !!utils.getActivePIOProjectDir();
if (!hasPIOProject || force) {
this.deactivate();
this._inited = false;
}
if (this._inited || (!hasPIOProject && this.getConfig().get('activateOnlyOnPlatformIOProject'))) {
if (!hasPIOProject && this.getConfig().get('activateOnlyOnPlatformIOProject')) {
return;
}

if (!this._initedBefore) {
pioNodeHelpers.misc.patchOSEnviron({
caller: 'vscode',
useBuiltinPIOCore: this.getConfig().get('useBuiltinPIOCore'),
extraPath: this.getConfig().get('customPATH'),
extraVars: {
PLATFORMIO_IDE: utils.getIDEVersion()
}
});
await this.startInstaller();
this.initDebug();
if (typeof this.getEnterpriseSetting('onPIOCoreReady') === 'function') {
await this.getEnterpriseSetting('onPIOCoreReady')();
pioNodeHelpers.misc.patchOSEnviron({
caller: 'vscode',
useBuiltinPIOCore: this.getConfig().get('useBuiltinPIOCore'),
extraPath: this.getConfig().get('customPATH'),
extraVars: {
PLATFORMIO_IDE: utils.getIDEVersion()
}
}

});
await this.startInstaller();
vscode.commands.executeCommand('setContext', 'pioCoreReady', true);

if (typeof this.getEnterpriseSetting('onPIOCoreReady') === 'function') {
await this.getEnterpriseSetting('onPIOCoreReady')();
}

this.initDebug();
this.registerGlobalCommands();

// workaround: init empty Tasks view to keep it above QuickAccess
this.taskSubscriptions.push(
vscode.window.registerTreeDataProvider('platformio-activitybar.tasks',
new TasksTreeProvider([]))
);
this.subscriptions.push(
vscode.window.registerTreeDataProvider('platformio-activitybar.quickAccess',
new QuickAccessTreeProvider())
Expand All @@ -100,9 +91,6 @@ class PlatformIOVSCodeExtension {
this.initProjectIndexer();
await this.startPIOHome();
maybeRateExtension(this.context.globalState);

this._inited = true;
this._initedBefore = true;
}

getConfig() {
Expand Down Expand Up @@ -183,14 +171,15 @@ class PlatformIOVSCodeExtension {
}

async startPIOHome() {
if (!pioNodeHelpers.home.showAtStartup('vscode')) {
return;
}
// Hot-loading of PIO Home Server
try {
await pioNodeHelpers.home.ensureServerStarted();
} catch (err) {
return utils.notifyError('Start PIO Home Server', err);
console.warn(err);
// return utils.notifyError('Start PIO Home Server', err);
}
if (!pioNodeHelpers.home.showAtStartup('vscode')) {
return;
}
vscode.commands.executeCommand('platformio-ide.showHome');
}
Expand Down Expand Up @@ -307,6 +296,7 @@ class PlatformIOVSCodeExtension {
['$(cloud-upload)', 'PlatformIO: Upload to remote device', 'platformio-ide.remote'],
['$(trashcan)', 'PlatformIO: Clean', 'platformio-ide.clean'],
['$(beaker)', 'PlatformIO: Test', 'platformio-ide.test'],
['$(checklist)', 'PlatformIO: Run Task...', 'workbench.action.tasks.runTask'],
['$(plug)', 'PlatformIO: Serial Monitor', 'platformio-ide.serialMonitor'],
['$(terminal)', 'PlatformIO: New Terminal', 'platformio-ide.newTerminal']
]
Expand All @@ -325,6 +315,7 @@ class PlatformIOVSCodeExtension {

initProjectIndexer() {
const observer = new pioNodeHelpers.project.ProjectObserver({
ide: 'vscode',
createFileSystemWatcher: vscode.workspace.createFileSystemWatcher,
createDirSystemWatcher: (dir) => vscode.workspace.createFileSystemWatcher(path.join(dir, '*')),
withProgress: (task) => vscode.window.withProgress({
Expand Down Expand Up @@ -353,14 +344,18 @@ class PlatformIOVSCodeExtension {
doUpdate();
}

disposeLocalSubscriptions() {
vscode.commands.executeCommand('setContext', 'pioCoreReady', false);
pioNodeHelpers.misc.disposeSubscriptions(this.subscriptions);
}

disposeTaskSubscriptions() {
pioNodeHelpers.misc.disposeSubscriptions(this.taskSubscriptions);
}

deactivate() {
this.disposeTaskSubscriptions();
pioNodeHelpers.misc.disposeSubscriptions(this.subscriptions);
vscode.commands.executeCommand('setContext', 'pioCoreReady', false);
this.disposeLocalSubscriptions();
}
}

Expand Down

0 comments on commit c4b4757

Please sign in to comment.