Skip to content

Add task provider APIs #542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
daviwil opened this issue Jul 20, 2017 · 5 comments
Open

Add task provider APIs #542

daviwil opened this issue Jul 20, 2017 · 5 comments
Labels
Area-Tasks Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@daviwil
Copy link
Contributor

daviwil commented Jul 20, 2017

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?

@daviwil daviwil changed the title Add task provider APIs to VSCode module Add task provider APIs Jul 20, 2017
@daviwil daviwil added the Issue-Enhancement A feature request (enhancement). label Jul 20, 2017
@daviwil daviwil added this to the July 2017 milestone Jul 20, 2017
@nightroman
Copy link

It sounds good. I'll create a new command similar to New-VSCodeTask.ps1.

@nightroman
Copy link

nightroman commented Jul 20, 2017

This would be useful to know:

  • How is a registered command invoked internally? By powershell.exe or in the current session? In the terminal or integrated console?
  • Is there some conventional current location on invoking a registered command?
  • How is Register-EditorTask going to work if it is called with the Name already registered?
  • Can I call Register-EditorTask from Microsoft.VSCode_profile.ps1 instead of a workspace profile?

@nightroman
Copy link

Added the script Register-VSCodeTask.ps1. For now, it is available in the repository and PSGallery.

@nightroman
Copy link

@daviwil How is it going?

@daviwil
Copy link
Contributor Author

daviwil commented Aug 10, 2017

Hey Roman, sorry for the delay, I was out on vacation. I'll be getting started back on up on this work in a couple of days.

In progress code is in the https://github.com/daviwil/PowerShellEditorServices/tree/task-provider branch, stashing it momentarily while I look into something else.

@daviwil daviwil modified the milestones: July 2017, Backlog Oct 27, 2017
@rjmholt rjmholt added the Up for Grabs Will shepherd PRs. label Aug 9, 2018
@andyleejordan andyleejordan removed this from the Backlog milestone Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tasks Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

5 participants