1001Ferramentas
⚙️ Dev

VS Code tasks.json Generator

Build a VS Code tasks.json with label, type, command, group and problemMatcher. Includes configurable default shell.

VS Code tasks without memorising the schema

The VS Code tasks file lets you run project commands from the editor, with a shortcut and with the output captured. The real value is not saving a trip to the terminal — it is the problem matcher, which reads the output, recognises error messages and turns them into markers in the code and entries in the problems list.

Fill in the label, the type, the command and the group, and the page assembles the JSON with the correct schema version. The group is what makes the task appear under the run build or run test commands, and marking it as the group default is what allows firing it straight from the shortcut, without picking from a list.

The problem matcher field deserves attention. Leaving it empty makes the editor ask every time how to interpret the output, which gets tiring fast. Several matchers ship built in, and extensions add their own. When none fits, you can declare one with your own regular expression — and when the output has no errors to recognise, the right move is declaring an explicitly empty list so the editor stops asking.

Frequently asked questions

What is the difference between task types?
The shell type runs the command through the system shell, which allows pipes, redirection and shell variables. The process type runs the binary directly, with no shell in between — more predictable and free of escaping trouble, but without the shell features.
How do I pass arguments containing spaces?
Through the arguments field, as separate array items rather than concatenated into the command. That way the editor handles the escaping. Concatenating everything into one string is the most common source of a task that works in the terminal and fails in the editor.
Can tasks be chained?
They can, through the dependencies field, which takes one or several tasks. By default they run in parallel; to enforce order there is a sequential execution option. It is the mechanism used to compile before testing without needing an external script.

Related Tools