PowerShell / PowerShell/vscode-powershell

Feature Request: Call VSCode commands from $psEditor variable

Aperta
#804 4 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Area-psEditor Issue-Enhancement
Lingua principale
TypeScript
Stelle
1.9k
Fork
547
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It would be really cool if a PowerShell script were able to invoke VSCode commands, effectively automating the IDE from PowerShell. This could be exposed via the built-in $psEditor variable that's accessible in the VSCode-PowerShell environment.

Related to #773, but more broad.

If there's already a way to do this, I'd love to hear it. I've explored the Workspace and Window variables on the $psEditor object, along with the GetEditorContext() method output, and can't find any way to do this right now.

PS /Users/tsulli> $psEditor |gm

   TypeName: Microsoft.PowerShell.EditorServices.Extensions.EditorObject

Name                  MemberType Definition
----                  ---------- ----------
Equals                Method     bool Equals(System.Object obj)
GetEditorContext      Method     Microsoft.PowerShell.EditorServices.Extensions.EditorContext GetEditorContext()
GetHashCode           Method     int GetHashCode()
GetType               Method     type GetType()
RegisterCommand       Method     bool RegisterCommand(Microsoft.PowerShell.EditorServices.Extensions.EditorCommand editorCommand)
ToString              Method     string ToString()
UnregisterCommand     Method     void UnregisterCommand(string commandName)
EditorServicesVersion Property   version EditorServicesVersion {get;}
Window                Property   Microsoft.PowerShell.EditorServices.Extensions.EditorWindow Window {get;}
Workspace             Property   Microsoft.PowerShell.EditorServices.Extensions.EditorWorkspace Workspace {get;}

Cheers,
Trevor Sullivan

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 esaminando l’API integrata di $psEditor EditorObject, in particolare i relativi membri Workspace, Window, GetEditorContext(), RegisterCommand() e UnregisterCommand(), e confronta la richiesta più ampia con l’issue correlata #773. Il lavoro è completato quando uno script PowerShell nell’ambiente VSCode-PowerShell può invocare i comandi VSCode tramite $psEditor.

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

Valutazione

Stack tecnologico
powershell, typescript, vscode
Ambito
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.