- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3
Description
It'd be useful if in a regular VS Code task (https://code.visualstudio.com/docs/editor/tasks) the currently active task context name could be referenced dynamically.
My use case: I have a custom shell task which runs unit tests, and it'd be nice if I could have that shell task only run the unit tests in files that are in the current task context.  I can write a script to peek at the .vscode/tasks-context.json file to get the filenames, but that script has no way of knowing what the current task context is.  Right now the VS Code task looks something like:
{
    "label": "Run Unit Tests",
    "type": "shell",
    "group": {
        "kind": "test",
        "isDefault": true
    },
    "command": "./findAndRunTestsFromTaskContext.py",
    "problemMatcher": []
},
If the activated task were exposed in a variable then I could have the VS Code task definition reference that variable & pass to my script.  Ie I want to have my command in that task be something like:
"command": "./findAndRunTestsFromTaskContext.py ${config:tasks-context.activeTask}",
And have tasks-context.activeTask resolve to the current active task name or the empty string if there is no active task.
My current workaround is to have an input variable that prompts me to enter the task context name, but then I have to type it in every time I run the task (which is a bit annoying).
As a side-benefit: if the currently active task were a setting, then it'd presumably stay active on a restart of VS code (which currently doesn't happen, if I restart VS Code whatever active task context was in place at restart time is no longer active).