Inconsistencies task.json vs. task.json schema
Type: Bug
When trying to validate my task.json against the task.json schema published in the Appendix I noticed some inconsistencies.
-
beginsPattern/endsPatternThe schema defines them this way in theBackgroundMatcherinterfacebeginsPattern?: string; endsPattern?: string;But in VS Code I can define them this way:
"problemMatcher": { "base": "$tsc-watch", "background": { "activeOnStart": true, "beginsPattern": { "regexp": "(.*?)" }, "endsPattern": { "regexp": "bundle generation complete" } } },So while the schema restricts the value to be string, it also accepts
regexpin reality. Also IntelliSense provides this as a valid entry. -
Missing property "type"
The
TaskDescriptioninterface defines thetypelike thistype: 'shell' | 'process';It is therefore defined as a mandatory field. But in reality it is not. Otherwise it would not be possible to create a compound task as described in Compound Tasks
-
Missing property "command"
The
TaskDescriptioninterface defines thecommandlike thiscommand: string;It is therefore defined as a mandatory field. But in reality it is not. Otherwise it would not be possible to create a compound task as described in Compound Tasks
VS Code version: Code 1.98.1 (2fc07b811f760549dab9be9d2bedd06c51dfcb9a, 2025-03-10T15:38:08.854Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.98.2. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
An update of VS Code will probably not solve the issue. :)
IMHO the schema published at Appendix needs to be updated to match the current used version.
@meganrogge You marked this one with help wanted. I would try to help out, but actually I am not sure how.
- Where are the sources for the website so I could contribute to it?
- Where could I find the current schema file that would need to be pushed to the appendix?
In terms of the doc related suggestion+contributions, I believe https://github.com/microsoft/vscode-docs would be a good place. Specifically https://github.com/microsoft/vscode-docs/blob/main/docs/reference/tasks-appendix.md