Skip to content

postLaunchTask would be very useful #2405

Closed as not planned
Closed as not planned

Description

Currently we have the ability to specify a preLaunchTask in launch.json configurations. This is extremely helpful in running a task that should kick off before launch.

Conversely, there could be post launch tasks that would be helpful to automate their execution. An example of a post launch task would be to, after the launch of the application, open a browser window with a specific URL to the current application.

In summary, a postLaunchTask would be helpful as preLaunchTask is.

Activity

  1. added
    debug
    feature-request
    on Jan 27, 2016
  2. theBull commented on Aug 31, 2017

    @theBull

    Andre Weinand (@weinand) any updates on the progress of the postLaunchTask feature? Or perhaps, do you know of any existing extensions that can perform a similar function?

  3. isidorn commented on Sep 1, 2017

    @isidorn
  4. added
    help wanted
    on Sep 1, 2017
  5. cleidigh commented on Nov 28, 2017

    @cleidigh
    Contributor

    tstringer
    Isidor Nikolic (@isidorn)
    I will pick this up for December...

  6. markm77 commented on Jul 21, 2018

    @markm77

    Is it possible to support this for compound launch configs - so that, for example, once all my node-js processes are up, inject some scenario data or clear the DB from previous experiment....

  7. 9 remaining items

  8. removed
    help wanted
    on Dec 14, 2022
  9. roblourens commented on Dec 14, 2022

    @roblourens
    Member

    Since the original use-case mentions launching a browser after a server has started, I wonder whether https://code.visualstudio.com/docs/editor/debugging#_automatically-open-a-uri-when-debugging-a-server-program is sufficient for this? Does anyone have a scenario that can't be covered with that feature?

  10. added
    info-needed
    on Dec 14, 2022
  11. vscodenpa commented on Dec 23, 2022

    @vscodenpa

    This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

    Happy Coding!

  12. adellhk commented on Jan 12, 2023

    @adellhk

    roblourens in our usecase we are generating some code during the build step and we want to then bundle the generated code. It would be ideal to run the tasks that bundle the generated code as a postLaunchTask. For now we are just manually running the tasks after the build is done.

  13. roblourens commented on Jan 13, 2023

    @roblourens
    Member

    Not clear to me why that should be a postLaunchTask rather than part of the preLaunchTask

  14. adellhk commented on Jan 13, 2023

    @adellhk

    We're using VS Code and a well-supported VS-code extension to deploy code to Roku.
    image
    I want to bundle the files generated into out/.roku-deploy-staging after roku-deploy has created them with a hypothetical postLaunchTask after the launch task that we invoked with F5 completes.

  15. hwmaier commented on Jan 16, 2023

    @hwmaier

    Does anyone have a scenario that can't be covered with that feature?

    Yes, Refer to my comment above. With debuggers for embedded targets like the JLink Cortex ARM debugger you cannot use the postLaunch task because the debugger is not active yet. Certain things can only be done after the debugger has been started and at present those cannot be automated due to a missing postLaunchTask.

  16. roblourens commented on Jan 17, 2023

    @roblourens
    Member

    Adell (@adellhk) I still don't understand why it makes sense to bundle or deploy these files after debugging has already started.

    Henrik Maier (@hwmaier) thanks for the explanation. As a workaround it would probably be easy for someone to write an extension that essentially implements a postLaunchTask.

  17. cHemingway commented on Jan 18, 2023

    @cHemingway

    I also have the same scenario as Henrik Maier (@hwmaier) , also in embedded.
    I quite often want to attach a program (e.g. a terminal, or J-Link RTT Viewer) to a running debugger, but (without modifying the program) it won't work unless the debugger process has been started.
    For this use case, postLaunchTask would be very useful

  18. roblourens commented on Jan 20, 2023

    @roblourens
    Member

    Thanks. One reason I'm still hesitant to put this in vscode is that "postLaunch" is hard to define. There are multiple points in the debug setup flow that could be considered "postLaunch", and even then, there is no guarantee that the debuggee is in the right state that you need it in to be able to do what you want to do with it, and so I think a general "postLaunchTask" isn't the right direction.

    Instead you might try to write an extension that can do what you want. For an example, you can see what we did for the serverReadyAction feature with this extension:

    const listener = vscode.debug.onDidStartDebugSession(session => {

    We were solving the same problem there - for example, just because the web server process has started and a debugger has attached, it doesn't mean that the server is ready to handle requests, so we need to watch for a custom output string to know when the web server is ready.

  19. locked and limited conversation to collaborators on Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

debugfeature-requestinfo-needed

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions