Skip to content

eamodio/vscode-taskexplorer

 
 

Repository files navigation

Task Explorer - View and Run Tasks from Visual Studio Code

Version Installs Downloads Ratings authors PayPalDonate

Greenkeeper badge Build Status azuretests azurecoverage codecov CodeFactor

GitHub issues open GitHub issues closed GitHub pull requests GitHub last commit semantic-release

src0 src1 src2 src3 src13 src4 src5 src6 src7 src8 src9 src10 src11 src12

Description

Provides a view in either (or both) the SideBar and/or Explorer that displays all supported tasks organized into a treeview, with parent task file nodes, grouped nodes, and project folders (convenient for large multi-root workspaces). Tasks can be opened for view/edit, executed, and stopped, among other things for specific task types, for example NPM file nodes support common npm command(s) (i.e. 'install') via context menu.

Table of Contents

Screenshots by Version

Original Explorer Tray Sidebar View (v1.7) Task Type Groups (v1.13)
ss0 ss1 ss2
Grunt/Gulp in Subfolders (v1.14) Npm Commands (v1.16) Task Dashed Groups (v1.23)
ss4 ss5 ss6

Requirements

  • Visual Studio Code v1.30+

Features by Version

  • v1.26 - Add 'Running Task' status bar message (refs #47)
  • v1.25 - Add 'Last Tasks' pseudo-folder (closes #47)
  • v1.24 - Add 'Open Terminal' button to running tasks (closes #23)
  • v1.23 - Deeper groupings with dashed task groups (Off by default)
  • v1.22 - Major performance enhancements - Task Tree / Task Scanning
  • v1.21 - Add option to keep terminal open after stopping task (closes #51)
  • v1.20 - Add support for restarting task (thanks antfu)
  • v1.19 - App-Publisher task support for BETA testing
  • v1.18 - Add 'Add to excludes' action in task file node context menu
  • v1.17 - Add 'Run last task' button to titlebar
  • v1.16 - Add npm management tasks to npm file node context menus
  • v1.15 - Support for gradle tasks (includes provider) (closes #15)
  • v1.14 - Support for grunt and gulp task files not located in the project root (closes #12)
  • v1.13 - Multiple task files of the same type placed within a group node for less clutter in folder level nodes
  • v1.12 - Support for bash, batch, perl, powershell, python, ruby, and nsis scripts (includes provider)
  • v1.11 - N/A - Obsolete Batch Task Provider replaced by v1.12 ScriptProvider
  • v1.10 - Support for Makefiles (includes provider)
  • v1.9 - Support for gulp and grunt tasks (includes provider)
  • v1.8 - Support for ant files not named [Bb]uild.xml, ansicon output colorization fixed
  • v1.7 - Two view types - Use one or both of either SideBar View and/or Explorer Tray
  • v1.6 - Progress icons for running tasks
  • v1.6 - Stop execution button for running tasks
  • v1.5 - Support for Apache Ant tasks (includes provider)
  • v1.4 - Support for TSC tasks
  • v1.3 - Support for Visual Studio Code tasks
  • v1.2 - Convenient layout - groups all tasks by project folder, by task file, by task
  • v1.1 - Supports multi-root or single-root workspaces
  • v1.0 - Open and launch NPM scripts as tasks

Configuring Global Excludes and Apache Ant Includes

The setting exclude defines a file/directory pattern or an array of file/directory patterns to ignore using Glob Patterns or a valid File URI. The setting applies to all script types. For example:

  • taskExplorer.exclude: [ "**/.vscode-test/**", "**/vendor/**", "**/out/**", "**/output/**", "/c:/projects/project1/src/theme/test/package.json" ]

Note that the glob pattern "**/node_modules/**" is applied by default to the excludes list in all cases. Using the exclude configuration can greatly improve performance in large workspaces if configured correctly.

Task files that are found by Task Expolorer can also be added to the excludes list via the tree node context menu, by right clicking the task file or task group node, and selecting Add to Excludes.

Apache Ant uses an .xml file extension, the setting includeAnt can be used to specify other file names other than [Bb]uild.xml to include as ant files so that all xml files do not need to be searched (slowing down tree refreshes in large workspaces or project with a large number of various xml files). The setting defines a file pattern or an array of file patterns to include using Glob Patterns or a valid File URI, for example:

  • taskExplorer.includeAnt: [ "**/extraTasks.xml", "**/scripts/ant/*.xml", "/c:/projects/project1/scripts/test/antetests.xml" ]

Note that the glob pattern "**/[Bb]uild.xml" is applied by default to the Ant includes list in all cases.

Using Dashed Groups

EXPERIMENTAL Dashed Groups are simply an extra level of task groupings that can be made based on a dash (-) character in the script name. This option can be turned on/off with the Group Dashed option in Settings, the default is OFF.

For example, consider 10 npm tasks, 5 of which all start with the string dev-, 5 of which start with the string prod-. Prior to Version 1.23, this would create 10 individual task nodes within the main npm task node in the task tree:

npm
    dev-build
    dev-build-server
    dev-build-themes
    dev-cp-from-bin
    dev-clean
    prod-build
    prod-build-server
    prod-build-themes
    prod-cp-from-bin
    prod-clean

By enabling the Group Dashed option in Settings, two new grouped nodes would be created underneath the main npm node, one called dev and the other called prod. Each of these two sub-nodes of course would contain the respective dev- and prod- scrtips/tasks, minus the prepended group name:

npm
    dev
        build
        build-server
        build-themes
        cp-from-bin
        clean
    prod
        build
        build-server
        build-themes
        cp-from-bin
        clean

Internally Provided Tasks vs. VSCode Provided Tasks

The following tasks are provided by VSCode:

  • Workspace (.vscode/tasks.json)
  • NPM (**/package.json)

All other tasks are internaly provided. Workspace tasks are detected by VSCode in all cases. However, NPM tasks are detected only if the setting 'Npm -> Auto Detect' is turned on in VSCode Settings. By default this is turned on, but if NPM tasks are not displaying, please check this setting, also check the setting that turns npm package management off in favor of Yarn 'Npm -> Package manager'. A future release will contain internally provided NPM and Yarn tasks. Note these tasks are still displayed in the Task Tree, just not "provided" by this extension.

Detection of all internally provided task types can be turned on/off in Settings - 'Task Explorer -> Enable [Tasktype]'.

Running bash/sh scripts in Windows Environment

Bash/sh scripts in Windows will have the shell executable automatically set to a bash shell (if the default shell set in VSCode is not bash). The shell executable used can be set in Settings using the pathToBash setting. If there is no value set in Settings, and Git Bash exists at the default installation installation, Git Bash will be used (MinGW). If Git Bash does not exist at the default install location, it is assumed the the path to bash.exe is part of the system PATH variable. If you experience errors running Bash scripts in Windows, please check these items.

Feedback & Contributing

Rate It - Leave Some Stars

Please rate your experience with stars... like five of them ;)

Thank You

Other Code Extensions by spmeesseman

Package Repository Marketplace
svn-scm-ext GitHub Visual Studio Marketplace
vscode-vslauncher GitHub Visual Studio Marketplace

Donations

If my work and this extension has made your life easier, consider a donation. All donations go straight to the Single Dad ATM.

Development Notes

3/25/20 - CI has to be THE most overrated tech on the planet. CI should be named PA standing for "pain in the ass". These are personal notes for correcting CI issues that happen seemingly every other release.

When semantic release kindly creates the git version tag, then something bombs, run the following git commands to remove the git tag, remote and local:

git push origin :v1.26.1
git tag --delete v1.26.1

Babel runtime:

Errors in reelase when incuding babel runtime:

This extension consists of 379 files, out of which 230 are JavaScript files. For performance reasons, you should bundle your extension. You should also exclude unnecessary files by adding them to your .vscodeignore.

WHen messing with babel, and finishing, install/uninstall the runtime:

npm install @bebel/runtime

About

Run and Manage Tasks for Visual Studio Code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.1%
  • JavaScript 2.6%
  • Python 2.1%
  • Shell 0.2%
  • Makefile 0.0%
  • Batchfile 0.0%