-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to run tasks.json from launch.json even if it doesn't define multiple tasks #10211
Comments
fyi @dbaeumer |
@joshtynjala if you only have one command in the tasks.json you can refer to that 'task' using the command string. If the command is for example 'npm' we generate a task with the name npm which you then can use in the launch.json. I agree that this might be cumbersome if the command is a full path. Instead of having the launch.json fixing this we should allow to name single tasks in the tasks.json. |
Ah, thank you! I didn't realize that. Perhaps a note in this document that makes this special case more obvious would be helpful. I would not have guessed on my own that the "command" field could be used like this.
Agreed. Luckily, I'm running things that are in the PATH environment variable.
This would be convenient! I'm planning to write some tutorials for the language extension that I'm working on, and I'm sure at least some of my users will prefer to run commands with the full path. Being able to name the task "build" or "compile" in the tutorial would make things cleaner for everyone, full path or not. |
ping @gregvanl |
You can now add a label to any task, and use that label to refer to the task in |
launch.json offers the preLaunchTask field to run a specific task before debugging. This works great if I'm using Gulp or something else that supports multiple task names. However, if I set up a tasks.json that simply runs an executable, such as a compiler, there seems to be no easy way to run this singular task before launching. There is no task name, so I have nothing to pass to preLaunchTask. I'm forced to manually build with Ctrl+Shift+B before I launch.
It would be great if I could set it up so that my tasks.json would run automatically on launch. Maybe a new field, like the example below, where it runs whatever is associated with Ctrl+Shift+B:
The text was updated successfully, but these errors were encountered: