Vscode: Allow multiple preLaunchTasks to be defined

Created on 29 Jan 2019  路  17Comments  路  Source: microsoft/vscode

I would like to be able to have the launch.json preLaunchTask be an array of tasks rather than just one. While it is possible to create a compound task, this requires that the compound task also have a label which pollutes the tasks shown when choosing to run a task. Instead, I would like just have the launch config just be able to launch more than one.

In my scenario, I have tasks defined with labels "Watch", and "Dev Server". On debug launch, I want to be able to both ensure the Watch and "Dev Server" tasks have started (if not already running).

*out-of-scope debug feature-request

Most helpful comment

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

All 17 comments

@akrantz this is a fair feature request.

@alexr00 would this be possible by using task groups? For example the user would put "Watch", and "Dev Server" in one task group and then reference that task group from the preLaunchTask?

The only way this is possible right now is with a compound task (dependsOn). The group is not exposed in this way for preLaunchTask. How would we know if the value of preLaunchTask is a group or a task name/label.

You can see an example of how preLaunchTask is currently being used here: https://github.com/OfficeDev/Excel-Custom-Functions/tree/master/.vscode

I had made this feature request because while I was able to do things with preLaunchTask, it pointed out that it would be better to be able to have multiple preLaunchTasks. The reason is that the complexity can easily get out of hand in the task definitions if you want different launch configs with different preLaunchTask combinations and you then have to define compound tasks for them all.

Also, as I stated before, you end up polluting tasks, and the Run Task... option will show these other compound tasks. It would be better to not have to define the compound tasks, but rather express the multiple preLaunchTasks in the launch config.

In the example above, we've documented that users should run Watch themselves first, and the Dev Server task is optional because the "office-addin-debugging start" command will start the dev server if not running. However, it would be more ideal if we could add DevServer and Watch to the preLaunchTask so they would both be run first, followed by the current preLaunchTask which starts debugging.

https://docs.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-debugging#use-the-vs-code-debugger-for-excel-desktop

Please note that this is now possible https://github.com/microsoft/vscode/issues/45676
It does not give you 100% what you want but might help

https://stackoverflow.com/questions/51599106/visual-studio-code-running-prelaunchtask-with-multiple-tasks
hey it should work for you.

In addition-if you are using unix command line then you can put as text in the args the rest of the tasks separated with ';' to be execute sequentially.

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

I need this too

Please make postDebugTasks work with multiple as well (this makes sense if preLaunchTasks will support it).

We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@isidorn While I respect the VS Code team's decision as to whether it is reasonable to implement, is it possible to get information about why it was considered "out of scope"? Is this a problem with the request itself, or do resource or schedule constraints simply preclude this from being done? It would be nice to have more of your thoughts about this. Thanks.

Sure. I consider this out of scope because as a workaround a user can use compound tasks and than depend on the compound task from the prelaunch task. While I guess this is not ideal, I think it brings a kind of workaround.
Also I have no plans to work on this area in the immediate future.

@isidorn Sure, compound tasks can be used but what I tried to point out is that it does lead to problems. Is this something where an outside contributor could do the work? It seems you have the expertise here but you don't view it as a priority -- which I can understand -- but I am wondering if it would be realistic to have someone else look to doing the work if it is important enough to them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jez9999 picture jez9999  路  234Comments

Tyriar picture Tyriar  路  200Comments

hsdk123 picture hsdk123  路  263Comments

filfat picture filfat  路  246Comments

stoffeastrom picture stoffeastrom  路  380Comments