Skip to content

Commit d607a3c

Browse files
committed
Merge branch 'release/v0.2.0'
2 parents f5e3a45 + 041f74d commit d607a3c

File tree

11 files changed

+149
-32
lines changed

11 files changed

+149
-32
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
# 0.1.0
1+
# Release Notes
2+
3+
## 0.2.0 (2017-05-29)
4+
5+
* PlatformIO Toolbar in Status Bar (Build, Upload, Clean, Run Tasks, New Project, Serial Monitor, and Terminal)
6+
* Improved auto installer for PIO Core
7+
* Improved C/C++ Code Completion
8+
9+
## 0.1.0 (2017-05-28)
210

311
* Initial release

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,40 @@
22

33
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version-short/platformio.platformio-ide.svg)](https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide) [![Installs](https://vsmarketplacebadge.apphb.com/installs-short/platformio.platformio-ide.svg)](https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide) [![Rating](https://vsmarketplacebadge.apphb.com/rating-short/platformio.platformio-ide.svg)](https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide)
44

5-
[PlatformIO IDE](http://platformio.org/platformio-ide) is the next generation integrated development environment for IoT.
5+
**The next generation integrated development environment for IoT**
66

7-
[PlatformIO](http://platformio.org/) is an open source ecosystem for IoT development.
7+
[PlatformIO](http://platformio.org) is an open source ecosystem for IoT development.
88
Cross-platform build system and unified debugger. Remote unit testing and firmware updates.
99

1010
*Atmel AVR & SAM, Espressif 8266 & 32, Freescale Kinetis, Intel ARC32, Lattice iCE40,
11-
Microchip PIC32, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32,
11+
Maxim Integrated MAX32, Microchip PIC32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32,
1212
TI MSP430 & Tiva, Teensy, Arduino, ARM mbed, libOpenCM3, ESP8266, etc.*
1313

1414
## Features
1515

1616
* Cross-platform code builder without external dependencies to a system software:
1717

18-
- 350+ embedded boards
18+
- 400+ embedded boards
1919
- 20+ development platforms
2020
- 10+ frameworks
2121

22+
* [PIO Remote™](http://docs.platformio.org/page/plus/pio-remote.html)
2223
* [PIO Unified Debugger](http://docs.platformio.org/page/plus/debugging.html)
24+
* [Unit Testing](http://docs.platformio.org/page/plus/unit-testing.html)
2325
* C/C++ Intelligent Code Completion
2426
* C/C++ Smart Code Linter for rapid professional development
2527
* Library Manager for the hundreds popular libraries
2628
* Multi-projects workflow with multiple panes
2729
* Themes support with dark and light colors
2830
* Serial Port Monitor
29-
* Built-in Terminal with PlatformIO Core tool (``pio``, ``platformio``)
31+
* Built-in Terminal with [PlatformIO Core](http://docs.platformio.org/page/core.html) tool (``pio``, ``platformio``)
3032

3133
## How it works
3234

35+
* [Installation](http://docs.platformio.org/page/ide/vscode.html#installation)
36+
* [Quick Start](http://docs.platformio.org/page/ide/vscode.html#quick-start)
37+
* [User Guide](http://docs.platformio.org/page/ide/vscode.html#user-quide)
38+
3339
Please follow to the official documentation [PlatformIO IDE for VSCode](http://docs.platformio.org/page/ide/vscode.html).
3440

3541
[![PlatformIO IDE for VSCode](https://raw.githubusercontent.com/platformio/platformio-docs/develop/_static/ide/vscode/platformio-ide-vscode.png)](http://platformio.org/platformio-ide)
@@ -47,5 +53,5 @@ This extension contributes the following settings:
4753

4854
Copyright 2017-present PlatformIO <contact@platformio.org>
4955

50-
The PlatformIO is licensed under the permissive Apache 2.0 license,
56+
The PlatformIO IDE for VSCode is licensed under the permissive Apache 2.0 license,
5157
so you can use it in both commercial and personal projects with confidence.

package.json

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "platformio-ide",
3+
"preview": true,
34
"displayName": "PlatformIO IDE",
45
"description": "Official PlatformIO IDE for VSCode: The next generation integrated development environment for IoT. Cross-platform build system and unified debugger. Remote unit testing and firmware updates.",
56
"keywords": [
67
"PlatformIO",
78
"IoT",
89
"debugger",
9-
"unittest",
10+
"unittest",
1011
"embedded",
1112
"arduino",
1213
"mbed",
@@ -21,21 +22,21 @@
2122
"hardware",
2223
"serial",
2324
"monitor"
24-
],
25+
],
2526
"categories": [
2627
"Languages",
2728
"Debuggers",
2829
"Other"
2930
],
30-
"icon": "images/icon.svg",
31-
"version": "0.1.0",
31+
"icon": "images/icon.svg",
32+
"version": "0.2.0",
3233
"author": {
3334
"name": "PlatformIO.Org"
34-
},
35+
},
3536
"publisher": "platformio",
3637
"license": "Apache-2.0",
3738
"engines": {
38-
"vscode": "^1.12.0"
39+
"vscode": "^1.9.0"
3940
},
4041
"bugs": {
4142
"url": "https://github.com/platformio/platformio-vscode-ide/issues"
@@ -44,13 +45,33 @@
4445
"repository": {
4546
"type": "git",
4647
"url": "https://github.com/platformio/platformio-vscode-ide.git"
47-
},
48+
},
4849
"activationEvents": [
4950
"*"
5051
],
5152
"main": "./lib/index",
5253
"contributes": {
5354
"commands": [
55+
{
56+
"command": "platformio-ide.build",
57+
"title": "Build",
58+
"category": "PlatformIO"
59+
},
60+
{
61+
"command": "platformio-ide.upload",
62+
"title": "Upload",
63+
"category": "PlatformIO"
64+
},
65+
{
66+
"command": "platformio-ide.clean",
67+
"title": "Clean",
68+
"category": "PlatformIO"
69+
},
70+
{
71+
"command": "platformio-ide.serialMonitor",
72+
"title": "Serial Monitor",
73+
"category": "PlatformIO"
74+
},
5475
{
5576
"command": "platformio-ide.initProject",
5677
"title": "Initialize or update project",
@@ -65,7 +86,12 @@
6586
"command": "platformio-ide.newTerminal",
6687
"title": "New Terminal",
6788
"category": "PlatformIO"
68-
}
89+
},
90+
{
91+
"command": "platformio-ide.libraryManager",
92+
"title": "Library Manager",
93+
"category": "PlatformIO"
94+
}
6995
],
7096
"configuration": {
7197
"type": "object",

src/commands/init.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
import { runPioCommand } from '../utils';
1010
import vscode from 'vscode';
1111

12+
1213
export default async function initCommand() {
1314
if (!vscode.workspace.rootPath) {
1415
vscode.window.showWarningMessage(
15-
'PlatformIO projec could not be initialized. Please open a folder '
16+
'PlatformIO project could not be initialized. Please open a folder '
1617
+ 'first before performing initialization.'
1718
);
1819
}
1920
await vscode.window.withProgress({
20-
title: 'PlatformIO Project initialization',
21+
title: 'PlatformIO Project initialization...',
2122
location: vscode.ProgressLocation.Window,
2223
}, async (progress) => {
2324
progress.report({
@@ -57,7 +58,7 @@ export default async function initCommand() {
5758
});
5859

5960
await new Promise((resolve, reject) => {
60-
runPioCommand(['init', '--ide', '--vscode', '--board', selectedBoard.boardId, '--project-dir', vscode.workspace.rootPath], (code, stdout, stderr) => {
61+
runPioCommand(['init', '--ide', 'vscode', '--board', selectedBoard.boardId, '--project-dir', vscode.workspace.rootPath], (code, stdout, stderr) => {
6162
if (code !== 0) {
6263
reject(stderr);
6364
} else {

src/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const IS_WINDOWS = process.platform.startsWith('win');
1515
export const PIO_HOME_DIR = _getPioHomeDir(process.env.PLATFORMIO_HOME_DIR || path.join(fs.getHomeDirectory() || '~', '.platformio'));
1616
export const ENV_DIR = path.join(PIO_HOME_DIR, 'penv');
1717
export const ENV_BIN_DIR = path.join(ENV_DIR, IS_WINDOWS ? 'Scripts' : 'bin');
18-
export const PIO_CORE_MIN_VERSION = '3.4.0-b.7';
18+
export const PIO_CORE_MIN_VERSION = '3.4.0-b.9';
19+
1920

2021
function _getPioHomeDir(pioHomeDir) {
2122
if (IS_WINDOWS) {

src/extension.js

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ import path from 'path';
1616
import semver from 'semver';
1717
import vscode from 'vscode';
1818

19+
1920
export default class PlatformIOVSCodeExtension {
2021

2122
constructor() {
2223
this.activate = this.activate.bind(this);
23-
24-
const min = 100;
25-
const max = 999;
26-
this.instanceId = Math.floor(Math.random() * (max - min)) + min;
2724
}
2825

2926
async activate(context) {
@@ -40,13 +37,40 @@ export default class PlatformIOVSCodeExtension {
4037
await indexer.toggle();
4138

4239
// Create Terminal Instance with pre-configured environment PATH
43-
this.initTerminal();
40+
let pioTerm = this.newPIOTerminal();
4441

42+
// Commands
4543
context.subscriptions.push(
4644
vscode.commands.registerCommand(
47-
'platformio-ide.newTerminal',
48-
() => this.initTerminal().show())
49-
);
45+
'platformio-ide.build',
46+
utils.makeCommandWithArgs('workbench.action.tasks.runTask', 'PlatformIO: Build'))
47+
);
48+
context.subscriptions.push(
49+
vscode.commands.registerCommand(
50+
'platformio-ide.upload',
51+
utils.makeCommandWithArgs('workbench.action.tasks.runTask', 'PlatformIO: Upload'))
52+
);
53+
context.subscriptions.push(
54+
vscode.commands.registerCommand(
55+
'platformio-ide.clean',
56+
utils.makeCommandWithArgs('workbench.action.tasks.runTask', 'PlatformIO: Clean'))
57+
);
58+
context.subscriptions.push(
59+
vscode.commands.registerCommand(
60+
'platformio-ide.serialMonitor',
61+
() => {
62+
pioTerm.sendText('pio device monitor');
63+
pioTerm.show();
64+
})
65+
);
66+
context.subscriptions.push(
67+
vscode.commands.registerCommand(
68+
'platformio-ide.libraryManager',
69+
() => {
70+
pioTerm.sendText('pio lib');
71+
pioTerm.show();
72+
})
73+
);
5074
context.subscriptions.push(
5175
vscode.commands.registerCommand(
5276
'platformio-ide.initProject',
@@ -59,17 +83,51 @@ export default class PlatformIOVSCodeExtension {
5983
verbose: true,
6084
}))
6185
);
86+
context.subscriptions.push(
87+
vscode.commands.registerCommand(
88+
'platformio-ide.newTerminal',
89+
() => {
90+
pioTerm = this.newPIOTerminal();
91+
pioTerm.show() ;
92+
})
93+
);
94+
95+
// Status Bar
96+
context.subscriptions.push(
97+
utils.makeStatusBarItem('$(check)', 'PlatformIO: Build', 'platformio-ide.build', 8)
98+
);
99+
context.subscriptions.push(
100+
utils.makeStatusBarItem('$(arrow-right)', 'PlatformIO: Upload', 'platformio-ide.upload', 7)
101+
);
102+
context.subscriptions.push(
103+
utils.makeStatusBarItem('$(trashcan)', 'PlatformIO: Clean', 'platformio-ide.clean', 5)
104+
);
105+
context.subscriptions.push(
106+
utils.makeStatusBarItem('$(checklist)', 'PlatformIO: Run a Task', 'workbench.action.tasks.runTask', 5)
107+
);
108+
context.subscriptions.push(
109+
utils.makeStatusBarItem('$(file-code)', 'PlatformIO: Initialize or update project', 'platformio-ide.initProject', 4)
110+
);
111+
context.subscriptions.push(
112+
utils.makeStatusBarItem('$(code)', 'PlatformIO: Library Manager', 'platformio-ide.libraryManager', 3)
113+
);
114+
context.subscriptions.push(
115+
utils.makeStatusBarItem('$(plug)', 'PlatformIO: Serial Monitor', 'platformio-ide.serialMonitor', 2)
116+
);
117+
context.subscriptions.push(
118+
utils.makeStatusBarItem('$(terminal)', 'PlatformIO: New Terminal', 'platformio-ide.newTerminal', 1)
119+
);
62120
}
63121

64-
initTerminal() {
122+
newPIOTerminal() {
65123
const terminal = vscode.window.createTerminal('PlatformIO');
66124
if (constants.IS_WINDOWS) {
67125
terminal.sendText('set PATH=' + process.env.PATH);
68126
} else if (process.env.SHELL && process.env.SHELL.includes('fish')) {
69127
terminal.sendText('set -gx PATH ' + process.env.PATH.replace(/\:/g, ' '));
70128
} else {
71129
terminal.sendText('export PATH=' + process.env.PATH);
72-
}
130+
}
73131
terminal.sendText('pio --help');
74132
return terminal;
75133
}
@@ -101,6 +159,7 @@ export default class PlatformIOVSCodeExtension {
101159
message: 'Installing PlatformIO IDE...',
102160
});
103161
const outputChannel = vscode.window.createOutputChannel('PlatformIO Instalation');
162+
outputChannel.show();
104163

105164
outputChannel.appendLine('Installing PlatformIO Core...');
106165
outputChannel.appendLine("Please don't close this window and don't "

src/installer/manager.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class InstallationManager {
2626
new PlatformIOCoreStage(this.onDidStatusChange.bind(this), this.stateStorage, {
2727
useBuiltinPIOCore: config.get('useBuiltinPIOCore'),
2828
setUseBuiltinPIOCore: (value) => config.update('platformio-ide.useBuiltinPIOCore', value),
29-
useDevelopmentPIOCore: config.get('useDevelopmentPIOCore') || true, // FIXME: remove "|| true" when released
29+
useDevelopmentPIOCore: config.get('useDevelopmentPIOCore') || true, // @FIXME: remove "|| true" when released
3030
installConfirm: new VscodePythonInstallConfirm(),
3131
cacheDir: cacheDir,
3232
isPrerelease: isPrerelease,
@@ -85,7 +85,6 @@ export default class InstallationManager {
8585
}
8686
}
8787

88-
8988
destroy() {
9089
return this.stages.map(stage => stage.destroy());
9190
}

src/installer/python-install-confirm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import open from 'open';
1010
import vscode from 'vscode';
1111

12+
1213
export default class VscodePythonInstallConfirm {
1314

1415
TRY_AGAIN = 0;

src/installer/stages/platformio-core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import path from 'path';
1717
import semver from 'semver';
1818
import tmp from 'tmp';
1919

20+
2021
export default class PlatformIOCoreStage extends BaseStage {
2122

2223
static UPGRADE_PIOCORE_TIMEOUT = 86400 * 3 * 1000; // 3 days

src/project/indexer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { getCurrentPythonExecutable, isPioProject, runPioCommand, spawnCommand }
1212
import path from 'path';
1313
import vscode from 'vscode';
1414

15+
1516
export default class ProjectIndexer {
1617

1718
constructor(projectPath) {

src/utils.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import path from 'path';
1313
import spawn from 'cross-spawn';
1414
import vscode from 'vscode';
1515

16+
1617
export function updateOSEnviron() {
1718
// Fix for platformio-atom-ide/issues/112
1819
process.env.LC_ALL = 'en_US.UTF-8';
@@ -29,7 +30,7 @@ export function updateOSEnviron() {
2930
}
3031
}
3132

32-
const config = vscode.workspace.getConfiguration('platformio-ide');
33+
const config = vscode.workspace.getConfiguration('platformio-ide');
3334
if (config.get('useBuiltinPIOCore')) { // Insert bin directory into PATH
3435
if (!process.env.PATH.includes(ENV_BIN_DIR)) {
3536
process.env.PATH = ENV_BIN_DIR + path.delimiter + process.env.PATH;
@@ -187,3 +188,16 @@ function isPython2(executable) {
187188
);
188189
});
189190
}
191+
192+
export function makeCommandWithArgs(command, ...args) {
193+
return () => vscode.commands.executeCommand(command, ...args);
194+
}
195+
196+
export function makeStatusBarItem(text, tooltip, command, priority) {
197+
const item = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, priority);
198+
item.text = text;
199+
item.tooltip = tooltip;
200+
item.command = command;
201+
item.show();
202+
return item;
203+
}

0 commit comments

Comments
 (0)