Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the tasks.json file in vscode?

I just start to use vscode in linux. I know that the build configuration are set in tasks.json. But where does this file locate?

I tried Ctrl-Shift-P then

tasks, no commands matching.

build, no commands matching.

I also tried to find it in ~/.vscode folder, nothing here!

Is there a way to find / open this file?

like image 209
Nick Avatar asked Dec 14 '15 13:12

Nick


People also ask

Where Is tasks json in VS Code?

Workspace or folder specific tasks are configured from the tasks.json file in the .vscode folder for a workspace. Extensions can also contribute tasks using a Task Provider, and these contributed tasks can add workspace-specific configurations defined in the tasks.json file.

How do I view a json file in Visual Studio?

This is a simple extension to Visual Studio for displaying and manipulating JSON data. After installation it is available in the main menu: Tools -> JSON Viewer.

How do I open json file in Visual Studio Code?

In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch. json . And it will open the launch.


2 Answers

  1. Open a folder with vscode
  2. Hit F1
  3. Select "Tasks: Configure Task"
  4. Hit Enter and vscode will create a sample task.json for you

enter image description here

like image 123
Steffen Avatar answered Oct 04 '22 07:10

Steffen


DANGER! All of this has changed. Current Microsoft docs on this topic are NOT consistent. Note the version warning at the top of this:

https://code.visualstudio.com/docs/editor/tasks

Note the conflicts between this:

https://docs.microsoft.com/en-us/visualstudio/ide/customize-build-and-debug-tasks-in-visual-studio?view=vs-2017

and this:

https://code.visualstudio.com/docs/languages/cpp

I cannot get a straight answer on what works now (12MAR2019) to save my life, but I can tell you that none of the permutations I've tried, namely:

{., .vs, .vscode} / { tasks.json, tasks.vs.json}

are working for me. It really drives me crazy that they changed this crap without updating ALL of the pertinent documentation, and the backward-compatibility "support" is just making things MUCH WORSE.

like image 21
breakpoint Avatar answered Oct 04 '22 06:10

breakpoint