microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.23k stars 28.56k forks source link

"dependsOrder" property does nothing when task type is "npm" #223944

Open shadeyg56 opened 1 month ago

shadeyg56 commented 1 month ago

Does this issue occur when all extensions are disabled?: Yes

Hi, I am working on an extension for VSCode and there are a few tasks defined that transpile and launch the extension. All of these tasks make use of npm scripts. The build task depends on two other npm script tasks. I have "dependsOrder" set to "sequence" but they run in parallel no matter what I do.

Below is a snippet of the tasks in question

"tasks": [
        {
            "label": "Build Extension Debug",
            "detail": "Debug Build uses esbuild to transpile code to js, then launches the Extension",
            "type": "npm",
            "script": "esbuild-debug",
            "problemMatcher": "$tsc-watch",
            "isBackground": true,
            "presentation": {
                "reveal": "always",
                "echo": false,
                "clear": true
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "dependsOrder": "sequence",
            "dependsOn": [
                "Install Dependencies",
                "Build newProject view",
            ],
        },
        {
            "label": "Install Dependencies",
            "type": "npm",
            "script": "installDependencies",
            "detail": "Install missing node_modules from all folders",
            "group : "build",
            "problemMatcher": []
        },
        {
            "type": "npm",
            "script": "esbuild",
            "path": "apps/newProject",
            "group": "build",
            "label": "Build newProject view",
            "problemMatcher": [],
        }

This can be reproduced by having running the "Build Extension Debug" task

shadeyg56 commented 1 month ago

It works as intended when I change the "Build Extension Debug" task type to "shell" instead of "npm"

{
    "label": "Build Extension Debug",
    "detail": "Debug Build uses esbuild to transpile code to js, then launches the Extension",
    "type": "shell",
    "command": "npm run esbuild-debug",
    "problemMatcher": "$tsc-watch",
    "isBackground": true,
    "presentation": {
        "reveal": "always",
        "echo": false,
        "clear": true
    },
    "group": {
        "kind": "build",
        "isDefault": true
    },
    "dependsOrder": "sequence",
    "dependsOn": [
        "Install Dependencies",
        "Build newProject view",
    ],
},

Using this as a workaround for now and changing the title to reflect this