Microsoft/vscode

Inconsistencies task.json vs. task.json schema

已關閉

#243,556 建立於 2025年3月14日

 (4 則留言) (0 個反應) (1 位負責人)TypeScript (39,847 個分叉)batch import
bughelp wantedtasks

倉庫指標

星標
 (184,936 顆星)
PR 合併指標
 (平均合併 11小時 43分鐘) (30 天內合併 1,000 個 PR)

描述

Type: Bug

When trying to validate my task.json against the task.json schema published in the Appendix I noticed some inconsistencies.

  1. beginsPattern/ endsPattern The schema defines them this way in the BackgroundMatcher interface

    beginsPattern?: 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 regexp in reality. Also IntelliSense provides this as a valid entry.

  2. Missing property "type"

    The TaskDescription interface defines the type like this

    type: '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

  3. Missing property "command"

    The TaskDescription interface defines the command like this

    command: 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

貢獻者指南