PowerShell / PowerShell/PowerShellEditorServices

Add task provider APIs

Open
#542 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Tasks Issue-Enhancement Up for Grabs
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

VS Code 1.14 includes a new task provider concept which allows extensions to dynamcially register tasks that show up in the "Tasks: Run Task" menu. I think this would be really useful for the following scenarios:

  • Generating tasks from psake or Invoke-Build scripts (@nightroman)
  • Generating tasks for Pester tests if any are detected in the project
  • Generating tasks for PSGallery operations (publish, etc)

However, I think that generating tasks from build scripts is probably what people would be doing 99% of the time.

@nightroman, I'd love to work with you to get Invoke-Build hooked up with this for the next PowerShell extension update. Here's what I'm thinking:

  • Editor Services will provide new cmdlets for registering "editor tasks" with a syntax like this:

    Register-EditorTask -Name "Build" -Source "Invoke-Build" -Command "Invoke-Build .\build.ps1 Build"

  • Invoke-Build will provide a new command (very similar to New-VSCodeTask.ps1) which will check for the existence of Register-EditorTask (or PSES being loaded) and then register all available tasks in the editor using the aforementioned command

  • The user will create a workspace profile which will invoke your command on their build script so that the build tasks are auto-registered when they load the project in VS Code.

How does that sound? Can you see any problems with this approach? Any better ideas?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked VS Code 1.14 task provider documentation and the existing New-VSCodeTask.ps1 approach mentioned in the issue. The proposal also references Register-EditorTask and workspace profiles, but no implementation files or tests are identified. Done would require an agreed API and a concrete implementation plan for registering tasks from build scripts and other providers.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, vscode
Domain
api, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.