From 174bd61f09ddd9e909ecc72c7b71c19eb032e159 Mon Sep 17 00:00:00 2001 From: Greg Van Liew Date: Wed, 1 Nov 2017 11:39:10 -0700 Subject: [PATCH] Update taskName to label Fixes #1181 --- docs/editor/tasks-appendix.md | 2 +- docs/editor/tasks.md | 22 +++++++++++----------- docs/languages/cpp.md | 8 ++++---- docs/languages/css.md | 18 +++++++++--------- docs/languages/javascript.md | 5 ++--- docs/languages/markdown.md | 10 ++++------ 6 files changed, 31 insertions(+), 34 deletions(-) diff --git a/docs/editor/tasks-appendix.md b/docs/editor/tasks-appendix.md index 74953ccd4a..16d824daa2 100644 --- a/docs/editor/tasks-appendix.md +++ b/docs/editor/tasks-appendix.md @@ -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 diff --git a/docs/editor/tasks.md b/docs/editor/tasks.md index dfe3c869fe..562db18fee 100644 --- a/docs/editor/tasks.md +++ b/docs/editor/tasks.md @@ -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": { @@ -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. @@ -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": { @@ -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": [ @@ -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" @@ -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": [ @@ -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": { @@ -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. @@ -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" } @@ -721,7 +721,7 @@ The corresponding `2.0.0` configuration would look like this: "taskSelector": "/t:", "tasks": [ { - "taskName": "build" + "label": "build" } ] } @@ -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", diff --git a/docs/languages/cpp.md b/docs/languages/cpp.md index 8fd6e956d8..a7a03f4a80 100644 --- a/docs/languages/cpp.md +++ b/docs/languages/cpp.md @@ -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: @@ -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": [ @@ -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": [ diff --git a/docs/languages/css.md b/docs/languages/css.md index 815b6fc3fe..afe870e1b3 100644 --- a/docs/languages/css.md +++ b/docs/languages/css.md @@ -118,21 +118,21 @@ 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" } ] @@ -140,16 +140,16 @@ This will create a sample `tasks.json` file in the workspace `.vscode` folder. ``` ```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" } ] @@ -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. diff --git a/docs/languages/javascript.md b/docs/languages/javascript.md index b0e71f68e7..dcb0dab8ff 100644 --- a/docs/languages/javascript.md +++ b/docs/languages/javascript.md @@ -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 } ] diff --git a/docs/languages/markdown.md b/docs/languages/markdown.md index b136537411..7aafb52880 100644 --- a/docs/languages/markdown.md +++ b/docs/languages/markdown.md @@ -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: @@ -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" } @@ -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" @@ -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": [],