Provide Task Runner viewlet
See original GitHub issueWe did a Task 2.0 deep dive today and this issue collects the combined feedback received.
Task Properties
- echo should be true by default so that users get a better idea of the task executed
- we should support flattening the JSON properties as we do with other settings (e.g
"terminal.echo": true
instead of"terminal": { "echo": true }
- we should better separate task declaration from task customization. Currently both happens in the tasks array property and the differentiating element is the
customize
property.
Task Picker
The task picker should support a decription / detail message to better explain what the task does. We also discussed whether the task picker should support MRU which would automatically move the most used tasks up to the top without customization. If we provide a task panel (see below) such a MRU list could be useful there as well.
Task Customization
The task customization is currently instance based where the task instance is identified by a task id, which can be quite ‘cryptic’. An alternative way would be to identify a task based on a type and a key that is defined by the type and therefore can vary from task runner to task runner. So instead of having something like:
{
"customize": "vscode.npm.run build",
"taskName": "npm: run build"
}
a customization would look like this
{
"customize": {
"type": "npm",
"file": "${workspaceRoot}/package.json",
"script": "build"
},
"problemMatcher": ["$tsc"]
}
where the structure of the identifying attribute is defined by the extension providing the runner support. In the example above the fact that a npm script is identified by the location of the package.json file and the script name comes from the npm extension. This might look different for task contributed by gulp of TypeScript
Problem Matchers
For task that execute a target of a task runner (e.g. gulp, npm, grunt) VS Code can’t decide which problem matchers to attach. Since picking the right problem matcher currently requires editing the tasks.json file we should better support the user with this. We discussed the following ideas:
- always attach all known problem matchers if a task has no problem matchers. This might result in false positives and might require us to support removing problem matchers via a configuration mechanism.
- we could help the user attaching a problem matcher by generically scanning the output for problems and suggest problem matchers that exactly match these. If selected we update the tasks.json file for the user.
Task panel
It was suggested to run tasks in its own panel instead of reusing the terminal panel. They should still be executed using the terminal to get ANSI control character support and other nice terminal features (e.g. Ctrl+C). The panel could offer additional features like:
- a task summary (execution time, exit code, …)
- the output of a task could be folded (like travis does for example)
- allow for in place customization of a task (for example attach a problem matcher) without the user being forced to edit a tasks.json file.
We also discussed the need of a task viewlet but decided that this will not add any big additional value over the task picker and a separate panel.
Top Level Menu
We were also discussing whether the tasks deserve a top level menu. In general this was consider a good idea. However such a menu should be semantically not technical. So instead of naming it Tools or Tasks it would be better to offer top level menus like Build, Rebuild All, Clean, Run Tests. The downside of such an approach is that such a menu looks out of place if none of these entries trigger any meaningful action in the workspace (e.g. if a simple JS project is open at lease Build, Rebuild All and Clean don’t make any sense)
Better Selfhosting
Would be great if we can improve the self hosting coverage of tasks. This is currently hard to do due to the fact how we build. But @dbaeumer will tweak our tasks.json to support more tasks currently run in the terminal (e.g run tests, linting, …)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:33
- Comments:46 (27 by maintainers)
Top GitHub Comments
I would still want us to explore the possibility of a panel for tasks, I think UX scalability as reason to not do it is not very fair, we need to solve the panel overflow no matter what in the same way we solved it for the activity bar (being able to show/hide panels, reorder them, see a “…” overflow menu when space is too little).
I do agree though there is some overlap in Debug Console, Integrated Terminal, Output and Tasks, however I am not sure if it would make sense to put them all into one. There is very specific scenarios for each of the panels:
Here is a mockup for the Tasks panel:
We can provide an explicit configure action per task which would guide users to configure problem matchers. We can make all tasks discoverable from here by having a dropdown to show all tasks that can be executed.
/cc @stevencl
So I have been thinking about how I would like it to be. As I already mentioned I like the solution from JetBrains and from Visual Studio.
Here is a suggestion. What do you think? Of course there are things I haven’t figured out yet, but it’s a first draft suggestion at least.