openfl / lime-vscode-extension

Visual Studio Code extension for OpenFL and Lime projects written in Haxe
https://marketplace.visualstudio.com/items?itemName=openfl.lime-vscode-extension
MIT License
27 stars 4 forks source link

HTML5 Debug: when launching the lime debug configuration, if the lime test task is already running, use lime build for the preLaunchTask instead #63

Closed joshtynjala closed 4 years ago

joshtynjala commented 4 years ago

If I launch the "lime" debug configuration, it automatically runs the "lime: test html5 -debug -nolaunch" task. This command builds the project, starts a server, and opens Chrome.

Example launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Lime",
            "type": "lime",
            "request": "launch"
        }
    ]
}

When I close Chrome, the debugger disconnects. However, the server keeps running.

Later, if I've make some changes to my code, and I tell VSCode to start debugging again, the "lime: test html5 -debug -nolaunch" is already running. In that case, VSCode skips the task and just opens a browser. Nothing gets built, so my changes to the code are not reflected in what is loaded in the browser.

Since running "lime test" builds the project before launching a server, I think that, for consistency, the extension should run "lime build" if "lime test" is already active.

joshtynjala commented 4 years ago

Some more background, just in case it isn't clear:

I need a workflow similar to what I have in other languages, where I can press a button to tell VSCode to start debugging, and it will automatically build before launching the debugger. Normally, VSCode allows users to specify a preLaunchTask for any task, but the Lime extension is overwriting that field so I can't do that.

joshtynjala commented 4 years ago

Thanks!