@@ -6,11 +6,32 @@ import * as vscode from 'vscode';
66// this method is called when your extension is activated
77// your extension is activated the very first time the command is executed
88let commandOutput = null ;
9- let spawnCMD = require ( 'spawn-command' ) ;
9+ let compileIcon : vscode . StatusBarItem ;
10+ let flashIcon : vscode . StatusBarItem ;
11+ let logIcon : vscode . StatusBarItem ;
12+
13+ const spawnCMD = require ( 'spawn-command' ) ;
1014
1115export function activate ( context : vscode . ExtensionContext ) {
1216 console . log ( 'Congratulations, your extension "vscode-mbed" is now active!' ) ;
13- commandOutput = vscode . window . createOutputChannel ( 'Shell' ) ;
17+
18+ // status bar item add
19+ compileIcon = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
20+ compileIcon . text = `$(diff-renamed) compile` ;
21+ compileIcon . show ( ) ;
22+ compileIcon . tooltip = 'Compile current mbed project' ;
23+
24+ flashIcon = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
25+ flashIcon . text = `$(circuit-board) flash` ;
26+ flashIcon . tooltip = 'Flash complied mbed binary into board' ;
27+ flashIcon . show ( ) ;
28+
29+ logIcon = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
30+ logIcon . text = `$(device-desktop) show output` ;
31+ logIcon . tooltip = 'Show output mbed board' ;
32+ logIcon . show ( ) ;
33+
34+ commandOutput = vscode . window . createOutputChannel ( 'MBED output' ) ;
1435 context . subscriptions . push ( commandOutput ) ;
1536 // add 'mbed new'
1637 context . subscriptions . push ( vscode . commands . registerCommand ( 'extension.mbed.new' , ( ) => {
@@ -46,7 +67,7 @@ export function activate(context: vscode.ExtensionContext) {
4667
4768export function run ( cmd :string , cwd :string ) : Promise < void > {
4869 return new Promise ( ( accept , reject ) => {
49- var opts : any = { } ;
70+ let opts : any = { } ;
5071 if ( vscode . workspace ) {
5172 opts . cwd = cwd ;
5273 }
@@ -72,7 +93,8 @@ export function exec(cmd:string, cwd:string): Promise<void> {
7293 return ;
7394 }
7495 commandOutput . clear ( ) ;
75- commandOutput . appendLine ( `> Running \`${ cmd } \`...` )
96+ commandOutput . show ( ) ;
97+ commandOutput . appendLine ( `> Running \`${ cmd } \`...` ) ;
7698 return run ( cmd , cwd ) ;
7799}
78100
0 commit comments