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?
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.
You have to create it manually. Current version of VS Code only creates
launch.json
automatically. Theauto detect
claims made in docs also don't work (for me at least).Here is a sample file you can create in
.vscode/tasks.json
that defines gulpjs tasks:2019 Version
I compiled this from the documentation:
First i tried
⬆︎ ⌘ B
... This didn't work for me (I was following a YouTube tutorial... a bit outdated it seems).After looking at the documetation i found that you have to initialize your typescript folder. To do so:
tsc --init
- this will generate a file called tsconfig.jsonThe documentation said to run
code .
after you rantsc --init
. Mine worked without is as well as with it. Feel free to play with it and see what it changes cause i honestly don't know.After that, move your mouse up to the toolbar (global Terminal menu.)... underneath the Terminal tab, click on the Configure Default Build Task...
then click on
tsc: build
and that will generate your tasks.jsonNote that mine generated without the "version": "2.0.0" line... so if yours did the same that means your hardware is too old and you have to upgrade.... i'm kidding! ... Just add
"version": "2.0.0",
right above"tasks": [
, and then you should be fine.✌