Skip to content

preLaunchTask does not fire on restart when adapter supportsRestartRequest #28979

Closed

Description

Steps to Reproduce:

  1. Create a build task called "Build" in tasks.json
  2. Create a launch configuration in launch.json
  3. set the "preLaunchTask": "Build"
  4. Launch with F5 and the build task will fire.
  5. Press Ctrl+Shift+F5 to restart the debugging session. the build does not fire first.
    Maybe we need a "preRestartTask"

Activity

  1. added
    debug
    on Jun 19, 2017
  2. isidorn commented on Jun 19, 2017

    @isidorn

    Works for me, restart will always trigger preLaunchTask.
    If you would like us to investigate further please provide a github repository for which you can easily reporduce this. Though I believe this is not a vscode issue since I see other users asking the opposite #17439

    restart

  3. added
    info-needed
    on Jun 19, 2017
  4. justin-romano commented on Jun 19, 2017

    @justin-romano
    Author

    Sorry i need to further qualify this issue. This is using the chrome debugger.

        "configurations": [{
                "type": "chrome",
                "request": "launch",
                "preLaunchTask": "Build",
                "name": "Launch Chrome against localhost",
                "url": "https://j2017.censored.com/censored/web/index.html",
                "webRoot": "${workspaceRoot}"
            }
  5. isidorn commented on Jun 20, 2017

    @isidorn

    That is because the chrome debuggers is using a custom restart feature.

    When a debug adapter is using this capability it is fully in charge what the restart exeprience should be like. So vscode does not do anything (including restarting the task). We currently do not support a half baked approach, where chrome would do some things in the restart and vscode the rest. Leaving this open as a feature request

    Ping roblourens to also get his opinion

  6. added
    feature-request
    and removed
    info-needed
    on Jun 20, 2017
  7. changed the title [-]preLaunchTask does not fire on restart[/-] [+]preLaunchTask does not fire on restart when adapter supportsRestartRequest[/+] on Jun 20, 2017
  8. roblourens commented on Jul 4, 2017

    @roblourens
    Member

    I think it should act the same as when running without supportsRestartRequest. If your task just does a build, then it would be really useful to have it run the build then refresh the browser. If it's a background task, then it should just refresh the browser.

  9. roblourens commented on Jul 4, 2017

    @roblourens
    Member

    I thought maybe there was another issue for this where we discussed it, but I can't find it. I don't think it would be possible for the debug extension to implement this.

  10. isidorn commented on Jul 17, 2017

    @isidorn

    roblourens yes I agree what would be the ideal solution, however as mentioned above due to the current implentation we are not doing that yet (running a prelaucnh task and starting a new debug session are coupled).
    Leaving this in the backlog until more users complain

  11. added
    bug
    on Nov 17, 2017
  12. 8 remaining items

  13. isidorn commented on Jun 12, 2018

    @isidorn

    Andre Weinand (@weinand) good point, I have tackled this via 27d0fc2

  14. chrmarti commented on Jun 28, 2018

    @chrmarti
    Collaborator

    I still see the preLaunchTask only run once with the Chrome debug adapter. What is the expected behavior?

  15. isidorn commented on Jun 28, 2018

    @isidorn

    That every time you restart the preLauncTask fires, if that is not the case please reopen and assign to July

  16. chrmarti commented on Jun 28, 2018

    @chrmarti
    Collaborator

    It works with the Node adapter, but not with the Chrome adapter. My launches:

            {
                "type": "node",
                "request": "launch",
                "name": "runawhile.js",
                "program": "${workspaceFolder}/runawhile.js",
                "preLaunchTask": "npm: hello1",
                "postDebugTask": "npm: hello2",
            },
            {
                "type": "chrome",
                "request": "launch",
                "name": "Chrome server.js",
                "url": "http://localhost:3000",
                "webRoot": "${workspaceFolder}/wwwroot",
                "preLaunchTask": "npm: hello1",
                "postDebugTask": "npm: hello2",
            },
  17. isidorn commented on Aug 2, 2018

    @isidorn
  18. locked and limited conversation to collaborators on Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdebtdebugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions