From b5eef4054e940a31ddd683e1370194d9adac8f8e Mon Sep 17 00:00:00 2001 From: JojoS62 Date: Tue, 16 Oct 2018 15:26:54 +0200 Subject: [PATCH 1/6] fix mbed detection and exceution path detect mbed-cli by using 'where' command on windows use uri.fsPath instead of uri.path for windows compatibility --- src/extension.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index b3764e1..d74eb6a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -113,7 +113,7 @@ export function exec(cmd:string, cwd:string): Promise { export function checkMbedInstalled(): Promise { return new Promise((resolve, reject) => { - process = spawnCMD('which mbed'); + process = (process.platform === 'win32') ? spawnCMD('where mbed') : spawnCMD('which mbed'); process.on('close', (status) => { if (status) { reject(`error`); @@ -162,7 +162,7 @@ export function mbedCompileProject() { const cmd = generateCommand(); const folder = vscode.workspace.workspaceFolders; - const path = vscode.workspace.workspaceFolders[0].uri.path; + const path = vscode.workspace.workspaceFolders[0].uri.fsPath; exec(cmd, path) .then(() => { vscode.window.showInformationMessage(`Successfully complied`) @@ -174,10 +174,10 @@ export function mbedCompileProject() { } export function mbedCompileAndFlashProject() { - const cmd = generateCommand(); + const cmd = generateCommand(); const folder = vscode.workspace.workspaceFolders; - const path = vscode.workspace.workspaceFolders[0].uri.path; + const path = vscode.workspace.workspaceFolders[0].uri.fsPath; exec(cmd, path) .then(() => { vscode.window.showInformationMessage(`Successfully complied`) From 0b6bb7a8fba59da5c4b5742538b6e5afde3589de Mon Sep 17 00:00:00 2001 From: JojoS62 Date: Tue, 16 Oct 2018 15:29:13 +0200 Subject: [PATCH 2/6] fix for flash command adding ' -f' option to mbed compile command for flashing after compiling. Needs 'auto' or 'detect' option as target setting. --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index d74eb6a..7edfd14 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -174,7 +174,7 @@ export function mbedCompileProject() { } export function mbedCompileAndFlashProject() { - const cmd = generateCommand(); + const cmd = generateCommand() + ' -f'; const folder = vscode.workspace.workspaceFolders; const path = vscode.workspace.workspaceFolders[0].uri.fsPath; From 2eacd0db4be16323959d7efdb3a8f3c3102729d3 Mon Sep 17 00:00:00 2001 From: JojoS62 Date: Thu, 25 Oct 2018 21:49:20 +0200 Subject: [PATCH 3/6] npm prebulish task --- .vscode/tasks.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 15beb96..49d1fb6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -30,6 +30,13 @@ "problemMatcher": [ "$tsc-watch" ] + }, + { + "type": "npm", + "script": "vscode:prepublish", + "problemMatcher": [ + "$tsc" + ] } ] } \ No newline at end of file From 683d5f99096d8b45e48b5c55d82d9bdfe0d2cccd Mon Sep 17 00:00:00 2001 From: JojoS62 Date: Thu, 25 Oct 2018 21:49:59 +0200 Subject: [PATCH 4/6] fix typo for extension.mbed.serialmonitor --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 7edfd14..c6358bd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -37,7 +37,7 @@ export function activate(context: vscode.ExtensionContext) { logIcon = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left); logIcon.text = `$(terminal) serial monitor`; logIcon.tooltip = 'Open serial monitor'; - logIcon.command = 'extensio.mbed.serialMonitor'; + logIcon.command = 'extension.mbed.serialMonitor'; logIcon.show(); commandOutput = vscode.window.createOutputChannel('mbed tasks'); From 755556d407b37de949c87edcfe17888033d81950 Mon Sep 17 00:00:00 2001 From: JojoS62 Date: Thu, 25 Oct 2018 21:51:38 +0200 Subject: [PATCH 5/6] exclude vsix files --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8c8220a..5fe00fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ out node_modules .vscode-test/ -.vsix +*.vsix From 94c4e8505fd1a54805653f0f92099bc77b8a58e7 Mon Sep 17 00:00:00 2001 From: JojoS62 Date: Thu, 22 Nov 2018 11:30:58 +0100 Subject: [PATCH 6/6] fixed typos --- src/extension.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index c6358bd..c25ee93 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -30,7 +30,7 @@ export function activate(context: vscode.ExtensionContext) { flashIcon = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left); flashIcon.text = `$(circuit-board) flash`; - flashIcon.tooltip = 'Flash complied mbed binary into board'; + flashIcon.tooltip = 'Flash compiled mbed binary into board'; flashIcon.command = 'extension.mbed.flash'; flashIcon.show(); @@ -165,7 +165,7 @@ export function mbedCompileProject() { const path = vscode.workspace.workspaceFolders[0].uri.fsPath; exec(cmd, path) .then(() => { - vscode.window.showInformationMessage(`Successfully complied`) + vscode.window.showInformationMessage(`Successfully compiled`) }).catch((reason) => { commandOutput.appendLine(`> ERROR: ${reason}`); vscode.window.showErrorMessage(reason, 'Show Output') @@ -180,7 +180,7 @@ export function mbedCompileAndFlashProject() { const path = vscode.workspace.workspaceFolders[0].uri.fsPath; exec(cmd, path) .then(() => { - vscode.window.showInformationMessage(`Successfully complied`) + vscode.window.showInformationMessage(`Successfully compiled`) }).catch((reason) => { commandOutput.appendLine(`> ERROR: ${reason}`); vscode.window.showErrorMessage(reason, 'Show Output')