microsoft / vscode

Visual Studio Code

Home Page:https://code.visualstudio.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Global task properties

o-lim opened this issue · comments

  • VSCode Version: 1.11.x
  • OS Version: Ubuntu 14.04

Several task properties , you would think are global, but are not, such as options and problemMatcher. For example, in the following task.json file, options and problemMatcher are ignored. In order for these properties to work, they must be replicated across all tasks in the task array, which really sucks, especially when you have 5+ tasks, each sharing the same set of problem matchers and options. What makes this even worse, is that you can't reference problem matchers by name, which means you have to type out the entire problem matcher definition, which is like 10+ lines, for each and every task.

{
    "version": "0.1.0",
    "command": "echo",
    "isShellCommand": true,
    "args": [],
    "showOutput": "always",
    "echoCommand": true,
    "suppressTaskName": true,
    "options": {
        "env": {
            "VAR": "xyz"
        }
    },
    "problemMatcher": [{
        ...
    }, {
        ...
    }],
    "tasks": [
        {
            "taskName": "hello",
            "args": ["Hello World"]
        },
        {
            "taskName": "bye",
            "args": ["Good Bye"]
        }
    ]
}

Global defined options shared between tasks, problem matchers not since they might differ between tasks.

Declaring global problem matchers and referencing them by name later makes sense and should be added.

Shared problem matchers still make sense, because you should be able to override them on a per task level. If not specified in a task, then they should default to the global problem matchers, otherwise the task level problem matchers should take precedence, overriding/replacing any global problem matchers.

I have the exact same problem.

I have many tasks. Most use the exact same problem matcher.
As is, I have to copy the HUGE problem matcher into each of the tasks.

It would be nice if you could created named problem matchers globally, and then just reference them by name in each tasks.

@alexr00 any update on this considering the october 2019 backlog passed almost a year ago?
Does that mean is not being considered anymore?

Given all the good stuff on our roadmap I just haven't had a chance to get to this issue. Its still on the backlog, which means that its something we'd like to work on at some point. However, there is currently no planned time to do it. Perhaps next time we do an issue grooming iteration I will have a chance to work on it.

Reusing problem matchers is tracked by #61497