PowerShell / PowerShell/PowerShellEditorServices

Add task provider APIs

Aperta
#542 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Area-Tasks Issue-Enhancement Up for Grabs
Lingua principale
C#
Stelle
767
Fork
266
Merge medio
3g 16h
PR unite (30g)
1

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo la documentazione collegata di VS Code 1.14 su task provider e l’approccio esistente con New-VSCodeTask.ps1 menzionato nell’issue. La proposta fa inoltre riferimento a Register-EditorTask e workspace profiles, ma non sono stati identificati file di implementazione o test. Per considerare il lavoro completato, sarebbero necessarie un’API concordata e un piano di implementazione concreto per registrare task dagli script di build e da altri provider.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell, vscode
Ambito
api, developer-experience, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.