Reputation: 121
I want "tasks: Allow Automatic Tasks In Folder" to be enabled by default when i open a project
this is the tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "gulp",
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
it runs on start but only if i call "tasks: Allow Automatic Tasks In Folder" via cmd+shift+p and reopen the project
i need this to be enabled by default. How can i do that ?
Upvotes: 11
Views: 2125
Reputation: 2852
Until VSCode 1.70 (July 2022) it was not possible to Allow Automatic Tasks in Folder by default. It has to be set by the instructions of Manuel Lehenberger.
Tasks: Manage Automatic Tasks in Folder
Allow Automatic Tasks in Folder
This has to be done once only. (for every project folder). I make it my routine when creating a new project folder or workspace.
Btw the tasks
- section can be incorperated in the .code-workspace
file thus removing the need for a .vscode
folder and tasks.json
file and reducing the clutter.
EDIT: Outdated
Upvotes: 0
Reputation: 1328282
With VSCode 1.70 (July 2022) and issue 64618, there will also be a setting associated with the command "Allow Automatic Tasks in Folder
".
See PR 154171 and commit 755d39f
There is now a task.allowAutomaticTasks
to enable automatic tasks in the folder, with:
task.allowAutomaticTasks.on
: Alwaystask.allowAutomaticTasks.auto
: Prompt for permission for each foldertask.allowAutomaticTasks.off
: NeverThis is available today (July 2022) in the insider release.
Upvotes: 3