From 6e27f754032d40ef5968a304b7f003560b7abd33 Mon Sep 17 00:00:00 2001 From: Olivier Guinart Date: Mon, 11 Sep 2017 21:33:12 -0700 Subject: [PATCH] Running merlin32.exe from the Terminal --- Test/HelloWorld.s | 11 +++++++++++ Test/test.s | 11 ----------- src/extension.ts | 13 +++++++------ 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 Test/HelloWorld.s delete mode 100644 Test/test.s diff --git a/Test/HelloWorld.s b/Test/HelloWorld.s new file mode 100644 index 0000000..2e2f2e3 --- /dev/null +++ b/Test/HelloWorld.s @@ -0,0 +1,11 @@ +; Uses S-C Assembler variant. +* This is also a valid comment... + org $800 +main ldy #$00 +start_loop lda HelloWorld,y + beq end_loop + jsr $fded ; ROM routine, COUT, y is preserved + iny + bne start_loop +end_loop rts +HelloWorld ASC "HELLO WORLD!"00 \ No newline at end of file diff --git a/Test/test.s b/Test/test.s deleted file mode 100644 index 9df551a..0000000 --- a/Test/test.s +++ /dev/null @@ -1,11 +0,0 @@ -; This is a comment -ADC X -DA Y -A EQU "STRING" -bne -BRA -* THat is a comment too. -"" - - - diff --git a/src/extension.ts b/src/extension.ts index b6850cd..953bbf2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -86,8 +86,6 @@ function activateHoverTooltips(context: vscode.ExtensionContext) { //************************************************************** function buildCommand() { - console.log("In buildCommand..."); - var buildCommand = ""; // Getting path to Merlin32 toolset buildCommand += vscode.workspace.getConfiguration("Merlin32").get("path", "Name"); @@ -97,9 +95,12 @@ function buildCommand() { buildCommand += "Merlin32"; // Adding the libraries argument buildCommand += " -V " + vscode.workspace.getConfiguration("Merlin32").get("libs", "Name"); - buildCommand += " HelloWorld.s"; + buildCommand += " " + vscode.window.activeTextEditor.document.fileName; - console.log("buildCommand = " + buildCommand); - - // TODO: checkout if the integrated terminal can then be used: https://code.visualstudio.com/docs/editor/integrated-terminal + // TODO: using the integrated terminal right now but tasks are probably better so the output of the build process is there + // and maybe even actionable (parse it for error, get line # and double-click can navigate to say line # + let terminal: vscode.Terminal; + terminal = vscode.window.createTerminal(); + terminal.show(); + terminal.sendText(buildCommand); }