PowerShell / PowerShell/PowerShellEditorServices

Support Set-PSBreakpoint showing breakpoints in the editor

Offen
#1,091 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Area-Debugging Issue-Enhancement
Vorherrschende Sprache
C#
Sterne
767
Forks
266
Ø Merge
3 T. 16 Std.
Gemergte PRs (30 T.)
1

Beschreibung

By creating a Proxy function of Set-PSBreakpoint, we can fire the breakpoint event as seen in the DAP spec to notify the client that a breakpoint has been added.

This is the really the final feature needed to provide the "console debugging in PSES experience" that feels totally integrated.

Creating a Proxy cmdlet is easy with:

$Metadata = [System.Management.Automation.CommandMetaData]::new((Get-Command Set-PSBreakpoint))
[System.Management.Automation.ProxyCommand]::Create($Metadata)

Then we'll need a way to give the EditorObject the state of the debugger... but mainly the JsonRpcServer object so that we can use it to send the SendNotification( method to send the breakpoint information to the client.

Then we take that proxy function and add something like:

$psEditor.Components
    .GetService([OmniSharp.Extensions.LanguageServer.Protocol.Server.ILanguageServer])
    .SendNotification("breakpoint", [OmniSharp.Extensions.DebugAdapter.Protocol.Events.BreakpointEvent]::new(<#...#>))

with some error handling and we should be good to go.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Lesen von EditorObject.cs und dem in der Issue beschriebenen Proxy-Ansatz für Set-PSBreakpoint. Verfolge, wie auf JsonRpcServer oder ILanguageServer zugegriffen wird, und prüfe anschließend BreakpointEvent in der DAP-Spezifikation sowie den referenzierten Protokolltyp. Erledigt ist die Aufgabe, wenn das Hinzufügen eines Breakpoints über Set-PSBreakpoint den Editor mit den Informationen zum Breakpoint benachrichtigt und eine Fehlerbehandlung vorhanden ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, powershell
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.