Skip to content

Commit

Permalink
Update taskName to label
Browse files Browse the repository at this point in the history
Fixes #1181
  • Loading branch information
Greg Van Liew committed Nov 1, 2017
1 parent 1705a0e commit 174bd61
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/editor/tasks-appendix.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ interface TaskDescription {
/**
* The task's name
*/
taskName: string;
label: string;

/**
* The type of a custom task. Tasks of type "shell" are executed
Expand Down
22 changes: 11 additions & 11 deletions docs/editor/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ We are working on more auto-detection support, so this list will get smaller and
"version": "2.0.0",
"tasks": [
{
"taskName": "Run tests",
"label": "Run tests",
"type": "shell",
"command": "./scripts/test.sh",
"windows": {
Expand All @@ -158,7 +158,7 @@ We are working on more auto-detection support, so this list will get smaller and

The task's properties have the following semantic:

- **taskName**: The tasks's name used in the user interface.
- **label**: The tasks's label used in the user interface.
- **type**: The task's type. For a custom task, this can either be `shell` or `process`. If `shell` is specified, the command is interpreted as a shell command (for example: bash, cmd, or PowerShell). If `process` is specified, the command is interpreted as a process to execute. If `shell` is used, any arguments to the command should be embedded into the `command` property to support proper argument quoting. For example, if the test script accepts a `--debug` argument then the command property would be: `./scripts/test.sh --debug`.
- **command**: The actual command to execute.
- **windows**: Any Windows specific properties. Will be used instead of the default properties when the command is executed on the Windows operating system.
Expand Down Expand Up @@ -230,7 +230,7 @@ You can also mix custom tasks with configurations for detected tasks. A `tasks.j
},
},
{
"taskName": "Run tests",
"label": "Run tests",
"type": "shell",
"command": "./scripts/test.sh",
"windows": {
Expand Down Expand Up @@ -354,7 +354,7 @@ Below is an example of a custom task configuration that passes the current opene

```json
{
"taskName": "TypeScript compile",
"label": "TypeScript compile",
"type": "shell",
"command": "tsc ${file}",
"problemMatcher": [
Expand All @@ -371,7 +371,7 @@ Below is an example that uses the Node.js executable as a command and is treated

```json
{
"taskName": "Run Node",
"label": "Run Node",
"type": "process",
"windows": {
"command": "C:\\Program Files\\nodejs\\node.exe"
Expand All @@ -396,7 +396,7 @@ Task properties can also be defined in the global scope. If present, they will b
},
"tasks": [
{
"taskName": "TS - Compile current file",
"label": "TS - Compile current file",
"type": "shell",
"command": "tsc ${file}",
"problemMatcher": [
Expand Down Expand Up @@ -632,10 +632,9 @@ A full handcrafted `tasks.json` for a `tsc` task running in watch mode looks lik
{
"version": "0.1.0",
"command": "tsc",
"suppressTaskName": true,
"tasks": [
{
"taskName": "watch",
"label": "watch",
"args": ["--watch"],
"isBackground": true,
"problemMatcher": {
Expand Down Expand Up @@ -668,6 +667,7 @@ If you have setup a workspace that consist out of multiple folders then only ver

Since the `2.0.0` version comes with lots of new auto-detection features, you can try removing an existing `tasks.json` file to see which tasks still work. Simply rename the existing `tasks.json` to `tasks.json.off`. If you have lots of customizations then you can switch by changing the version attribute to `"2.0.0"`. After doing so, you might encounter warnings because some old properties are now deprecated. Here is how to get rid of the deprecations:

- **taskName**: Use the `label` property instead.
- **isShellCommand**: Use the `"type": "shell"` property instead.
- **isBuildCommand**: Use the `"group": "build"` property instead.
- **isTestCommand**: Use the `"group": "test"` property instead.
Expand Down Expand Up @@ -701,7 +701,7 @@ The corresponding `2.0.0` configuration would look like this:
"version": "2.0.0",
"tasks": [
{
"taskName": "Run tests",
"label": "Run tests",
"type": "shell",
"command": "script test"
}
Expand All @@ -721,7 +721,7 @@ The corresponding `2.0.0` configuration would look like this:
"taskSelector": "/t:",
"tasks": [
{
"taskName": "build"
"label": "build"
}
]
}
Expand All @@ -733,7 +733,7 @@ A corresponding `2.0.0` configuration would look like this:
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"label": "build",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
Expand Down
8 changes: 4 additions & 4 deletions docs/languages/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ Below you can see that the MinGW C++ include path has been added to `browse.path
**If you want to build your application from VS Code, you will need to generate a `tasks.json` file:**

* Open the **Command Palette** (`kb(workbench.action.showCommands)`).
* Select the **Tasks: Configure Task Runner** command and you will see a list of task runner templates.
* Select the **Tasks: Configure Tasks...** command, click **Create tasks.json file from templates**, and you will see a list of task runner templates.
* Select **Others** to create a task which runs an external command.
* Change the `command` to the command line expression you use to build your application (for example `g++`).
* Add any required args (for example `-g` to build for debugging).
* You can also change the `taskName` to be more descriptive.
* You can also change the `label` to be more descriptive.

You should now see a `tasks.json` file in your workspace `.vscode` folder that looks something like:

Expand All @@ -91,7 +91,7 @@ You should now see a `tasks.json` file in your workspace `.vscode` folder that l
"version": "2.0.0",
"tasks": [
{
"taskName": "build hello world",
"label": "build hello world",
"type": "shell",
"command": "g++",
"args": [
Expand All @@ -109,7 +109,7 @@ If you'd like to be able to build your application with **Tasks: Run Build Task*
"version": "2.0.0",
"tasks": [
{
"taskName": "build hello world",
"label": "build hello world",
"type": "shell",
"command": "g++",
"args": [
Expand Down
18 changes: 9 additions & 9 deletions docs/languages/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,38 +118,38 @@ For the Less version of the above file, just change `$padding` to `@padding`.
### Step 3: Create tasks.json

The next step is to set up the task configuration. To do this open the **Command Palette** with `kb(workbench.action.showCommands)` and type in **Configure Task Runner**, press `kbstyle(Enter)` to select it. In the selection dialog that shows up, select `Others`.
The next step is to set up the task configuration. To do this, run **Tasks** > **Configure Tasks** and click **Create tasks.json file from templates**. In the selection dialog that shows up, select **Others**.

This will create a sample `tasks.json` file in the workspace `.vscode` folder. The initial version of file has an example to run an arbitrary command. We will modify that configuration for transpiling Less/Sass instead:
This will create a sample `tasks.json` file in the workspace `.vscode` folder. The initial version of file has an example to run an arbitrary command. We will modify that configuration for transpiling Sass/Less instead:

```json
// Less configuration
// Sass configuration
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "Less Compile",
"label": "Sass Compile",
"type": "shell",
"command": "lessc styles.less styles.css",
"command": "node-sass styles.scss styles.css",
"group": "build"
}
]
}
```

```json
// Sass configuration
// Less configuration
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "Sass Compile",
"label": "Less Compile",
"type": "shell",
"command": "node-sass styles.scss styles.css",
"command": "lessc styles.less styles.css",
"group": "build"
}
]
Expand All @@ -164,7 +164,7 @@ Since in more complex environments there can be more than one build task we prom

At this point, you should see an additional file show up in the file list `sample.html`.

If you want to make the task the default build task to run execute **Configure Default Build Task** from the global **Tasks** menu and select the corresponding **Sass** or **Less** task from the presented list.
If you want to make the task the default build task to run execute **Configure Default Build Task...** from the global **Tasks** menu and select the corresponding **Sass** or **Less** task from the presented list.

>**Note:** If your build fails or you see an error message such as "An output directory must be specified when compiling a directory", be sure the filenames in your `tasks.json` match the filenames on disk. You can always test your build by running `node-sass styles.scss styles.css` from the command line.
Expand Down
5 changes: 2 additions & 3 deletions docs/languages/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,8 @@ The [Babel](https://babeljs.io) transpiler turns ES6 files into readable ES5 Jav
"tasks": [
{
"args": ["src", "--out-dir", "lib", "-w", "--source-maps"],
"taskName": "watch",
"suppressTaskName": true,
"isBuildCommand": true,
"label": "watch",
"group": "build",
"isBackground": true
}
]
Expand Down
10 changes: 4 additions & 6 deletions docs/languages/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ Things you'll need:

### Step 3: Create tasks.json

The next step is to set up the task configuration file `tasks.json`. To do this, open the **Command Palette** with `kb(workbench.action.showCommands)` and type in **Configure Task Runner**, press `kbstyle(Enter)` to select it.

VS Code then presents a list of possible `tasks.json` templates to choose from. Select `Others` since we want to run an external command.
The next step is to set up the task configuration file `tasks.json`. To do this, run **Tasks** > **Configure Tasks** and click **Create tasks.json file from templates**. VS Code then presents a list of possible `tasks.json` templates to choose from. Select **Others** since we want to run an external command.

This generates a `tasks.json` file in your workspace `.vscode` folder with the following content:

Expand All @@ -169,7 +167,7 @@ This generates a `tasks.json` file in your workspace `.vscode` folder with the f
"version": "2.0.0",
"tasks": [
{
"taskName": "echo",
"label": "echo",
"type": "shell",
"command": "echo Hello"
}
Expand All @@ -186,7 +184,7 @@ To use **markdown-it** to compile the Markdown file, change the contents as foll
"version": "2.0.0",
"tasks": [
{
"taskName": "Compile Markdown",
"label": "Compile Markdown",
"type": "shell",
"command": "markdown-it sample.md -o sample.html",
"group": "build"
Expand All @@ -212,7 +210,7 @@ If you want to make the **Compile Markdown** task the default build task to run
"version": "2.0.0",
"tasks": [
{
"taskName": "Compile Markdown",
"label": "Compile Markdown",
"type": "shell",
"command": "markdown-it sample.md -o sample.html",
"problemMatcher": [],
Expand Down

0 comments on commit 174bd61

Please sign in to comment.