diff --git a/CHANGELOG.md b/CHANGELOG.md index 90141f9..9f0d805 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Release Notes +## 1.1.0 (2018-08-31) + +* New "Debug" group to "Quick Access" view + - "Start Debugging", will start debug session, activate debug console and focus "Debug" View + - "Toggle Debug Console", an optional button to show active debug console +* Improved support for Arduino files with `*.ino` extension +* Focus "Explorer" view when adding new project folder to workspace +* Do not shutdown PIO Home server when folder is added to workspace + ## 1.0.0 (2018-08-30) * [Multi-root Workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces), work on several related projects at one time (issue [#50](https://github.com/platformio/platformio-vscode-ide/issues/50)) diff --git a/package.json b/package.json index 42cbf85..4500ec8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-ide", - "version": "1.0.0", + "version": "1.1.0", "publisher": "platformio", "engines": { "vscode": "^1.24.0" @@ -15,10 +15,10 @@ ], "keywords": [ "IoT", + "c", + "c++", "embedded", - "firmware", - "debug", - "microcontroller" + "arduino" ], "main": "./lib/main", "icon": "resources/platformio-logo.png", @@ -70,6 +70,15 @@ ".s" ], "configuration": "./syntaxes/assembly-configuration.json" + }, + { + "id": "cpp", + "extensions": [ + ".ino" + ], + "aliases": [ + "Arduino" + ] } ], "grammars": [ @@ -87,6 +96,11 @@ "language": "platformio-debug.asm", "scopeName": "source.platformio-debug-asm", "path": "./syntaxes/assembly.tmLanguage" + }, + { + "language": "cpp", + "path": "./syntaxes/arduino.tmLanguage", + "scopeName": "source.cpp.arduino" } ], "commands": [ @@ -135,6 +149,11 @@ "title": "New Terminal", "category": "PlatformIO" }, + { + "command": "platformio-ide.startDebugging", + "title": "Start Debugging", + "category": "PlatformIO" + }, { "command": "platformio-ide.updateGlobalLibs", "title": "Update global libraries", diff --git a/src/home.js b/src/home.js index 3e7a149..5276777 100644 --- a/src/home.js +++ b/src/home.js @@ -75,6 +75,7 @@ export default class PIOHome { } else { vscode.commands.executeCommand('vscode.openFolder', vscode.Uri.file(params)); } + vscode.commands.executeCommand('workbench.view.explorer'); } } }); diff --git a/src/main.js b/src/main.js index c643b44..e0d580a 100644 --- a/src/main.js +++ b/src/main.js @@ -36,10 +36,16 @@ class PlatformIOVSCodeExtension { 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.reinit(); } @@ -53,10 +59,6 @@ class PlatformIOVSCodeExtension { return; } - this.pioHome = new PIOHome(); - this.pioTerm = new PIOTerminal(); - this.subscriptions.push(this.pioHome, this.pioTerm); - if (!this._initedBefore) { pioNodeHelpers.misc.patchOSEnviron({ caller: 'vscode', @@ -203,6 +205,14 @@ class PlatformIOVSCodeExtension { 'platformio-ide.newTerminal', () => this.pioTerm.new().show() ), + vscode.commands.registerCommand( + 'platformio-ide.startDebugging', + () => { + vscode.commands.executeCommand('workbench.view.debug'); + vscode.commands.executeCommand('workbench.debug.action.toggleRepl'); + vscode.commands.executeCommand('workbench.action.debug.start'); + } + ), vscode.commands.registerCommand( 'platformio-ide.updateGlobalLibs', () => this.pioTerm.sendText('platformio lib --global update') diff --git a/src/views/quick-access-tree.js b/src/views/quick-access-tree.js index 0ebdde6..66dceb2 100755 --- a/src/views/quick-access-tree.js +++ b/src/views/quick-access-tree.js @@ -31,6 +31,10 @@ export default class QuickAccessTreeProvider { new QuickItem('PIO Home', 'platformio-ide.showHome'), new QuickItem('New Terminal', 'platformio-ide.newTerminal'), new QuickItem('Clone Git Project', 'git.clone'), + new QuickItem('Debug', undefined, vscode.TreeItemCollapsibleState.Expanded, [ + new QuickItem('Start Debugging', 'platformio-ide.startDebugging'), + new QuickItem('Toggle Debug Console', 'workbench.debug.action.toggleRepl') + ]), new QuickItem('Updates', undefined, vscode.TreeItemCollapsibleState.Expanded, [ new QuickItem('Update global libraries', 'platformio-ide.updateGlobalLibs'), new QuickItem('Update platforms & packages', 'platformio-ide.updatePlatforms'), diff --git a/syntaxes/arduino.tmLanguage b/syntaxes/arduino.tmLanguage new file mode 100644 index 0000000..83ff413 --- /dev/null +++ b/syntaxes/arduino.tmLanguage @@ -0,0 +1,67 @@ + + + + + + scopeName + source.cpp.arduino + uuid + 65E5AFAE-4AE7-4DAE-837B-1B99810E464D + fileTypes + + ino + + foldingStartMarker + /\*\*|\{\s*$ + foldingStopMarker + \*\*/|^\s*\} + name + Arduino + patterns + + + match + \b(HIGH|LOW|INPUT|OUTPUT|INPUT_PULLUP|LED_BUILTIN|DEC|BIN|HEX|OCT|BYTE|PI|HALF_PI|TWO_PI|LSBFIRST|MSBFIRST|CHANGE|FALLING|RISING|DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56|null)\b + name + storage.type.cpp.arduino + + + match + \b(boolean|byte|word|string|String|array)\b + name + storage.cpp.arduino + + + match + \b(abs|acos|asin|atan|atan2|ceil|constrain|cos|degrees|exp|floor|log|map|max|min|radians|random|randomSeed|round|sin|sq|sqrt|tan|bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte|analogReference|analogRead|analogWrite|analogReadResolution|analogWriteResolution|attachInterrupt|detachInterrupt|delay|delayMicroseconds|digitalWrite|digitalRead|interrupts|millis|micros|noInterrupts|noTone|pinMode|pulseIn|shiftIn|shiftOut|tone|begin|end|read|print|println|available|flush)\b + name + support.function.cpp.arduino + + + match + \b\s*(setup|loop)\b + name + keyword.control.cpp.arduino + + + match + \b(Serial\d?|Stream|Keyboard|Mouse)\b + name + support.class.cpp.arduino + + + match + \b(private|protected|public) + name + storage.modifier.cpp.arduino + + + include + source.cpp + + + + \ No newline at end of file