Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Global Tasks in VS Code

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.

like image 332
GaryFurash Avatar asked Dec 08 '16 18:12

GaryFurash


People also ask

How do I open multiple workspaces in VS Code?

Double-click the . code-workspace file in your platform's Explorer. Use the File > Open Workspace command and select the Workspace file. Select the Workspace from the File > Open Recent (Ctrl+R) list.

How do I create a .VS Code folder?

In VS Code, press F5 to launch a new instance of VS Code with our new extension. Launch Command Palette from “View/Command Palette” menu ( or press ⇧⌘P in Mac OS), type Create New Folder in search bar and press Enter to execute.

What is task json in VS Code?

Tasks in VS Code can be configured to run scripts and start processes so that many of these existing tools can be used from within VS Code without having to enter a command line or write new code. Workspace or folder specific tasks are configured from the tasks. json file in the . vscode folder for a workspace.


2 Answers

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 
like image 134
benshabatnoam Avatar answered Sep 19 '22 03:09

benshabatnoam


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.

like image 28
Matt Bierner Avatar answered Sep 17 '22 03:09

Matt Bierner