Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a specific launch from task in vscode

When I open the project on vscode, I want it to start running in debug mode. I have a lunch configuration in the launch.json file which starts the project in debug mode when I hit "F5". In addition, I have a vscode task with the "runOptions": {"runOn":"folderOpen"} option. the problem is: as much as I can tell, tasks can only run commands or other tasks. is it possible to configure a command to run a specific "launch from the launch.json?

like image 362
רתם שורץ Avatar asked Sep 01 '25 01:09

רתם שורץ


1 Answers

You can use the extension Launch Configs

In the extension settings (settings.json) you setup a command to start a launch config

"launches": {
    "StartLaunch": "Start Launch (Project Folder)"
}

In you tasks.json call this task with a variable ${command:commandID} somewhere in the task strings.

${command:launches.StartLaunch}

You can use a dummy shell echo task

like image 181
rioV8 Avatar answered Sep 02 '25 15:09

rioV8