diff --git a/.gitignore b/.gitignore index adc7e6a..8a959f8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /lib/ *.vsix yarn.lock +*.dict +.vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 63395e3..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "files.exclude": { - "lib": true - }, - "search.exclude": { - "**/lib/**": true - }, - "files.watcherExclude": { - "**/.git/objects/**": true, - "**/lib/*": true, - "**/node_modules/**": true - } -} \ No newline at end of file diff --git a/package.json b/package.json index 4c753db..f151eb5 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,16 @@ { "name": "platformio-ide", - "version": "0.14.2", + "version": "0.15.0-beta.4", "publisher": "platformio", "engines": { - "vscode": "^1.18.0" + "vscode": "^1.23.0" }, "license": "Apache-2.0", "displayName": "PlatformIO IDE", "description": "Development environment for IoT, Arduino, ARM mbed, Espressif (ESP8266/ESP32), STM32, PIC32, nRF51/nRF52, FPGA, CMSIS, SPL, AVR, Samsung ARTIK, libOpenCM3", "categories": [ + "Programming Languages", "Debuggers", - "Languages", "Other" ], "keywords": [ diff --git a/src/constants.js b/src/constants.js index 72582fe..7e96b80 100644 --- a/src/constants.js +++ b/src/constants.js @@ -11,4 +11,4 @@ export const IS_OSX = process.platform == 'darwin'; export const IS_LINUX = !IS_WINDOWS && !IS_OSX; export const AUTO_REBUILD_DELAY = 3000; -export const PIO_CORE_MIN_VERSION = '3.5.2-rc.3'; +export const PIO_CORE_MIN_VERSION = '3.5.2'; diff --git a/src/home.js b/src/home.js index 0366bcb..53ef49f 100644 --- a/src/home.js +++ b/src/home.js @@ -12,13 +12,52 @@ import { extension } from './main'; import vscode from 'vscode'; -export class HomeContentProvider { +export default class PIOHome { - static shutdownServer() { - pioNodeHelpers.home.shutdownServer(); + constructor() { + this._currentPanel = null; + } + + toggle() { + if (this._currentPanel) { + this._currentPanel.reveal(vscode.ViewColumn.One); + } else { + this._currentPanel = this.newPanel(); + } + } + + async newPanel() { + const panel = vscode.window.createWebviewPanel( + 'pioHome', + extension.getEnterpriseSetting('pioHomeTitle', 'PIO Home'), + vscode.ViewColumn.One, + { + enableScripts: true, + retainContextWhenHidden: true + } + ); + panel.onDidDispose(this.onPanelDisposed.bind(this)); + panel.webview.html = this.getLoadingContent(); + this.getWebviewContent().then(html => panel.webview.html = html ); + return panel; } - async provideTextDocumentContent(uri) { + getTheme() { + const workbench = vscode.workspace.getConfiguration('workbench') || {}; + return (workbench.colorTheme || '').toLowerCase().includes('light') ? 'light' : 'dark'; + } + + getLoadingContent() { + const theme = this.getTheme(); + return ` + + + Loading... + + `; + } + + async getWebviewContent() { const params = await pioNodeHelpers.home.ensureServerStarted({ onIDECommand: (command, params) => { if (command === 'open_project') { @@ -26,11 +65,10 @@ export class HomeContentProvider { } } }); - const start = `/${ uri.authority }`; - const workbench = vscode.workspace.getConfiguration('workbench') || {}; - const theme = (workbench.colorTheme || '').toLowerCase().includes('light') ? 'light' : 'dark'; - return ` - + const start = '/'; + const theme = this.getTheme(); + return ` +