Making Global Tasks in VS Code

Visual Studio-Code

Visual Studio-Code Problem Overview


Is there a way to make "global" tasks, or do I always need to copy the same tasks.json into every project directory. VSCode seems to require that the task be in a .vscode directory within the current project folder.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

User level tasks is an available feature since VSCode January 2020 (version 1.42).

From the Release Notes:

> Tasks declared in tasks.json are now supported at the User Settings level. If you have a build script that you use across many projects, or if you don't want your tasks in a project folder, you can add your tasks in the user tasks.json file. Run the Tasks: Open User Tasks command to create user level tasks and these tasks will be available across all folders and workspaces. Only the shell and process task types are supported here.

In the Command Palette (CTRL + SHIFT + P) type:

> Tasks: Open User Tasks

Solution 2 - Visual Studio-Code

I'm on the VSCode team. As of VSCode 1.8, global configuration is not supported, but the feature is on our radar: https://github.com/Microsoft/vscode/issues/1435

Please let us know on GitHub if you have any suggestions on how this should behave.

Solution 3 - Visual Studio-Code

I found that Extension: Global Config

> Copies global config files (settings.json, tasks.json, etc.) to > workspace config folder

https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.global-config

Solution 4 - Visual Studio-Code

Feature is now supported in VSCode-Insiders version, just create a tasks.json where settings.json is located. (On windows it's "AppData\Roaming\Code - Insiders\User") Global tasks will be overwritten if project's tasks.json exists.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGaryFurashView Question on Stackoverflow
Solution 1 - Visual Studio-CodebenshabatnoamView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeMatt BiernerView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeJanView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeDanyilView Answer on Stackoverflow