From 3d09e905df070a3c984e4ef562dd355f4c67c1d2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 31 Aug 2018 14:11:19 +0300 Subject: [PATCH 1/7] Show "Project Tasks" before "Quick Access" in PlatformIO Activity Bar --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/main.js | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f0d805..82aa171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes +## 1.1.1 (2018-??-??) + +* Show "Project Tasks" before "Quick Access" in PlatformIO Activity Bar + ## 1.1.0 (2018-08-31) * New "Debug" group to "Quick Access" view diff --git a/package.json b/package.json index 4500ec8..b5c5cef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-ide", - "version": "1.1.0", + "version": "1.1.1-beta.1", "publisher": "platformio", "engines": { "vscode": "^1.24.0" diff --git a/src/main.js b/src/main.js index e0d580a..d8ef4ad 100644 --- a/src/main.js +++ b/src/main.js @@ -79,6 +79,11 @@ class PlatformIOVSCodeExtension { 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()) From 8fd9c24780cce94edd69dedcc605ce901a0379e7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 31 Aug 2018 18:50:02 +0300 Subject: [PATCH 2/7] Provide type of IDE to Project Indexer --- package.json | 2 +- src/main.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b5c5cef..0cccc4e 100644 --- a/package.json +++ b/package.json @@ -598,7 +598,7 @@ }, "dependencies": { "fs-plus": "^3.0.0", - "platformio-node-helpers": "^3.0.0", + "platformio-node-helpers": "^3.1.0", "platformio-vscode-debug": "^1.2.0" }, "extensionDependencies": [ diff --git a/src/main.js b/src/main.js index d8ef4ad..c3707e4 100644 --- a/src/main.js +++ b/src/main.js @@ -330,6 +330,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({ From 2b222beaeccae7b1737660ae344c597035cdda77 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 31 Aug 2018 18:51:48 +0300 Subject: [PATCH 3/7] Revert back "PlatformIO: Run Task..." button to PlatformIO Toolbar --- CHANGELOG.md | 1 + src/main.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82aa171..e2b1494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.1.1 (2018-??-??) * Show "Project Tasks" before "Quick Access" in PlatformIO Activity Bar +* Reverted back "PlatformIO: Run Task..." button to PlatformIO Toolbar ## 1.1.0 (2018-08-31) diff --git a/src/main.js b/src/main.js index c3707e4..16ae22d 100644 --- a/src/main.js +++ b/src/main.js @@ -312,6 +312,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'] ] From e46c9e6ce3cd1f8bcbf68b42c6567a77f5335ef9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 7 Sep 2018 23:07:43 +0300 Subject: [PATCH 4/7] Fixed "ImportError: cannot import name _remove_dead_weakref" and "[Errno 48] Address already in use" // Resolve #142, resolve #313 --- CHANGELOG.md | 2 ++ package.json | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2b1494..d83f460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Show "Project Tasks" before "Quick Access" in PlatformIO Activity Bar * Reverted back "PlatformIO: Run Task..." button to PlatformIO Toolbar +* 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)) ## 1.1.0 (2018-08-31) diff --git a/package.json b/package.json index 0cccc4e..e901f61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-ide", - "version": "1.1.1-beta.1", + "version": "1.1.1-beta.3", "publisher": "platformio", "engines": { "vscode": "^1.24.0" @@ -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", @@ -598,7 +598,7 @@ }, "dependencies": { "fs-plus": "^3.0.0", - "platformio-node-helpers": "^3.1.0", + "platformio-node-helpers": "^3.1.1", "platformio-vscode-debug": "^1.2.0" }, "extensionDependencies": [ From cd369081d3a428e0dc65dc630e5b39f512a685b4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 7 Sep 2018 23:11:46 +0300 Subject: [PATCH 5/7] Fixed issue when extension does not start after adding new project folder to workspace // Resolve #319 --- CHANGELOG.md | 2 ++ src/home.js | 8 ++----- src/main.js | 66 +++++++++++++++++++++------------------------------- 3 files changed, 31 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d83f460..a36b932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,10 @@ * 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) diff --git a/src/home.js b/src/home.js index 5276777..4ad29ef 100644 --- a/src/home.js +++ b/src/home.js @@ -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(); @@ -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(); } } diff --git a/src/main.js b/src/main.js index 16ae22d..0f2abda 100644 --- a/src/main.js +++ b/src/main.js @@ -29,54 +29,40 @@ 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 @@ -105,9 +91,6 @@ class PlatformIOVSCodeExtension { this.initProjectIndexer(); await this.startPIOHome(); maybeRateExtension(this.context.globalState); - - this._inited = true; - this._initedBefore = true; } getConfig() { @@ -188,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'); } @@ -360,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(); } } From 482291fa4e6afb454c813984f7d68a0dd1ec9e47 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 7 Sep 2018 23:21:54 +0300 Subject: [PATCH 6/7] Bump version to 1.1.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a36b932..9cd1137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes -## 1.1.1 (2018-??-??) +## 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 From f3f907014ce84a16768070f298128bb3b85655b4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 7 Sep 2018 23:22:16 +0300 Subject: [PATCH 7/7] Bump version to 1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e901f61..c7a0862 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-ide", - "version": "1.1.1-beta.3", + "version": "1.1.1", "publisher": "platformio", "engines": { "vscode": "^1.24.0"