Skip to content

Commit

Permalink
Merge branch 'release/v1.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Oct 11, 2019
2 parents b3ad6cf + dfa20fe commit c66f4bb
Show file tree
Hide file tree
Showing 15 changed files with 468 additions and 305 deletions.
7 changes: 0 additions & 7 deletions .esformatter

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release Notes

## 1.9.0 (2019-10-11)

- Python 3 has the highest priority over the Python 2
- Use Python 3.7 as a default installer for Windows
- Fixed an issue when debugger breakpoints are not activated on new debug session start (issue [#623](https://github.com/platformio/platformio-vscode-ide/issues/623))
- Fixed an issue when "breakpoint-hit" was not correctly handled by debugger in multi-threads application (RTOS, etc)

## 1.8.3 (2019-08-31)

- Fixed an issue with incorrect checking of a valid Python 3 interpreter
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "platformio-ide",
"version": "1.8.3",
"version": "1.9.0",
"publisher": "platformio",
"engines": {
"vscode": "^1.24.0"
Expand Down Expand Up @@ -582,7 +582,7 @@
},
"scripts": {
"lint": "eslint .eslintrc.js src",
"format": "esformatter -i .eslintrc.js 'src/**.js' && eslint --fix .eslintrc.js src",
"format": "prettier --single-quote --print-width 88 --write \"src/**/*.js\"",
"build": "webpack --mode production",
"vscode:package": "webpack --mode production && vsce package"
},
Expand All @@ -593,19 +593,19 @@
"babel-loader": "^8.0.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0",
"esformatter": "^0.10.0",
"eslint": "^6.0.1",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-import": "^2.14.0",
"prettier": "1.18.2",
"vsce": "^1.53.2",
"vscode": "^1.1.22",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2"
},
"dependencies": {
"fs-plus": "^3.1.1",
"platformio-node-helpers": "^5.0.5",
"platformio-vscode-debug": "^1.2.8"
"platformio-node-helpers": "^5.1.0",
"platformio-vscode-debug": "^1.2.10"
},
"extensionDependencies": [
"ms-vscode.cpptools"
Expand Down
5 changes: 4 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ export const IS_WINDOWS = process.platform.startsWith('win');
export const IS_OSX = process.platform == 'darwin';
export const IS_LINUX = !IS_WINDOWS && !IS_OSX;
export const PIO_CORE_MIN_VERSION = '4.0.0';
export const CONFLICTED_EXTENSION_IDS = ['llvm-vs-code-extensions.vscode-clangd', 'vsciot-vscode.vscode-arduino'];
export const CONFLICTED_EXTENSION_IDS = [
'llvm-vs-code-extensions.vscode-clangd',
'vsciot-vscode.vscode-arduino'
];
50 changes: 34 additions & 16 deletions src/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { notifyError } from './utils';
import path from 'path';
import vscode from 'vscode';


export default class PIOHome {

static defaultStartUrl = '/';

constructor() {
Expand All @@ -24,11 +22,15 @@ export default class PIOHome {
this._lastStartUrl = PIOHome.defaultStartUrl;

// close PIO Home when workspaces folders are changed (VSCode reactivates extensiuon)
this.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(this.disposePanel.bind(this)));
this.subscriptions.push(
vscode.workspace.onDidChangeWorkspaceFolders(this.disposePanel.bind(this))
);
}

async toggle(startUrl=PIOHome.defaultStartUrl) {
const column = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined;
async toggle(startUrl = PIOHome.defaultStartUrl) {
const column = vscode.window.activeTextEditor
? vscode.window.activeTextEditor.viewColumn
: undefined;
try {
if (this._currentPanel) {
if (this._lastStartUrl !== startUrl) {
Expand All @@ -53,7 +55,13 @@ export default class PIOHome {
}
);
this.subscriptions.push(panel.onDidDispose(this.onPanelDisposed.bind(this)));
panel.iconPath = vscode.Uri.file(path.join(extension.context.extensionPath, 'resources', 'platformio-mini-logo.svg'));
panel.iconPath = vscode.Uri.file(
path.join(
extension.context.extensionPath,
'resources',
'platformio-mini-logo.svg'
)
);
panel.webview.html = this.getLoadingContent();
try {
panel.webview.html = await this.getWebviewContent(startUrl);
Expand All @@ -65,7 +73,9 @@ export default class PIOHome {

getTheme() {
const workbench = vscode.workspace.getConfiguration('workbench') || {};
return (workbench.colorTheme || '').toLowerCase().includes('light') ? 'light' : 'dark';
return (workbench.colorTheme || '').toLowerCase().includes('light')
? 'light'
: 'dark';
}

getLoadingContent() {
Expand All @@ -86,9 +96,16 @@ export default class PIOHome {
if (command === 'open_project') {
this.disposePanel();
if (vscode.workspace.workspaceFolders) {
vscode.workspace.updateWorkspaceFolders(vscode.workspace.workspaceFolders.length, null, { uri: vscode.Uri.file(params)});
vscode.workspace.updateWorkspaceFolders(
vscode.workspace.workspaceFolders.length,
null,
{ uri: vscode.Uri.file(params) }
);
} else {
vscode.commands.executeCommand('vscode.openFolder', vscode.Uri.file(params));
vscode.commands.executeCommand(
'vscode.openFolder',
vscode.Uri.file(params)
);
}
vscode.commands.executeCommand('workbench.view.explorer');
}
Expand All @@ -97,12 +114,14 @@ export default class PIOHome {
const theme = this.getTheme();
return `<!DOCTYPE html>
<html lang="en">
<body style="margin: 0; padding: 0; height: 100%; overflow: hidden; background-color: ${theme === 'light' ? '#FFF' : '#1E1E1E'}">
<iframe src="${ pioNodeHelpers.home.getFrontendUri(params.host, params.port, {
start: startUrl,
theme,
workspace: extension.getEnterpriseSetting('defaultPIOHomeWorkspace')
})}"
<body style="margin: 0; padding: 0; height: 100%; overflow: hidden; background-color: ${
theme === 'light' ? '#FFF' : '#1E1E1E'
}">
<iframe src="${pioNodeHelpers.home.getFrontendUri(params.host, params.port, {
start: startUrl,
theme,
workspace: extension.getEnterpriseSetting('defaultPIOHomeWorkspace')
})}"
width="100%"
height="100%"
frameborder="0"
Expand All @@ -129,5 +148,4 @@ export default class PIOHome {
pioNodeHelpers.misc.disposeSubscriptions(this.subscriptions);
pioNodeHelpers.home.shutdownServer();
}

}
8 changes: 3 additions & 5 deletions src/installer/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import PythonPrompt from './python-prompt';
import StateStorage from '../state-storage';
import vscode from 'vscode';


export default class InstallationManager {

LOCK_TIMEOUT = 1 * 60 * 1000; // 1 minute
LOCK_KEY = 'platformio-ide:installer-lock';
STORAGE_STATE_KEY = 'platformio-ide:installer-state';
Expand All @@ -32,7 +30,8 @@ export default class InstallationManager {
{
pioCoreMinVersion: PIO_CORE_MIN_VERSION,
useBuiltinPIOCore: config.get('useBuiltinPIOCore'),
setUseBuiltinPIOCore: (value) => config.update('platformio-ide.useBuiltinPIOCore', value),
setUseBuiltinPIOCore: value =>
config.update('platformio-ide.useBuiltinPIOCore', value),
useDevelopmentPIOCore: config.get('useDevelopmentPIOCore'),
pythonPrompt: new PythonPrompt()
}
Expand Down Expand Up @@ -60,7 +59,7 @@ export default class InstallationManager {
if (!lockTime) {
return false;
}
return (new Date().getTime() - parseInt(lockTime)) <= this.LOCK_TIMEOUT;
return new Date().getTime() - parseInt(lockTime) <= this.LOCK_TIMEOUT;
}

async check() {
Expand All @@ -85,5 +84,4 @@ export default class InstallationManager {
destroy() {
return this.stages.map(stage => stage.destroy());
}

}
24 changes: 14 additions & 10 deletions src/installer/python-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,37 @@
import fs from 'fs-plus';
import vscode from 'vscode';


export default class PythonPrompt {

STATUS_TRY_AGAIN = 0;
STATUS_ABORT = 1;
STATUS_CUSTOMEXE = 2;

async prompt() {
const selectedItem = await vscode.window.showInformationMessage(
'PlatformIO: Can not find Python 2.7 Interpreter',
{ title: 'Install Python 2.7', isCloseAffordance: false },
{ title: 'I have Python 2.7', isCloseAffordance: false },
'PlatformIO: Can not find Python 2.7 or 3.5+ Interpreter',
{ title: 'Install Python', isCloseAffordance: false },
{ title: 'I have Python', isCloseAffordance: false },
{ title: 'Try again', isCloseAffordance: false },
{ title: 'Abort PlatformIO IDE Installation', isCloseAffordance: true }
);

switch (selectedItem ? selectedItem.title : undefined) {
case 'Install Python 2.7':
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('http://docs.platformio.org/page/faq.html#install-python-interpreter'));
case 'Install Python':
vscode.commands.executeCommand(
'vscode.open',
vscode.Uri.parse(
'http://docs.platformio.org/page/faq.html#install-python-interpreter'
)
);
return { status: this.STATUS_TRY_AGAIN };
case 'I have Python 2.7':
case 'I have Python':
return {
status: this.STATUS_CUSTOMEXE,
pythonExecutable: await vscode.window.showInputBox({
prompt: 'Please specify a full path to Python 2.7 executable file',
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
validateInput: value =>
!fs.isFileSync(value) ? 'Invalid path to Python Interpreter' : null
})
};
case 'Abort PlatformIO IDE Installation':
Expand Down
Loading

0 comments on commit c66f4bb

Please sign in to comment.