PowerShell / PowerShell/PowerShellEditorServices

Bring launch sequencing in line with DAP spec

Aperta
#2,191 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Prerequisites
  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been requested.
Summary

Currently, our DAP conversation doesn't follow the spec explicitly in terms of conversation.

What is supposed to happen:

  1. Initialize is sent and server responds, then responds with capabilities
  2. Launch is sent by client after receiving capabilities. should be held and deferred until configurationDone
  3. Server sends initialized event (preferably when ready to receive launch requests)
  4. Client does config after initialized
  5. Configuration is done (breakpoints etc.)
  6. launch request is now responded to after configuration is completed

In actuality, we respond to the launch request immediately before configuration
image

The spec states:

Once the debug adapter is ready to receive configuration from the client, it sends an initialized event to the client. As described above, the client sends zero or more configuration-related requests before sending a configurationDone request.

After the response to configurationDone is sent, the debug adapter may respond to the launch or attach request, and then the debug session has started.
Proposed Design

We need to hold the launch response until after configurationDone is completed. Fixing this would likely be part of a larger refactor to fix the odd behavior of scripts being started directly within configurationDone handler, rather than configurationDone triggering an event or otherwise to start/release any pending launch messages.

As part of this, because the spec currently does not allow multiplexing requests over a single adapter channel, the launch/attach should singleton and throw an error if any additional launch/attach requests are made until the existing one completes.

Implementation Idea

When a launch task is started, a TaskCompletionSource or otherwise should be started and awaited, and the configurationDone handler will complete that task, enabling the launch task to resume and return its startup response.

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 individuando gli handler DAP per launch/attach e configurationDone, quindi confronta il loro sequenziamento con la specifica DAP citata. Traccia il modo in cui vengono attualmente completati i launch tasks e le responses. Il lavoro è completato quando le responses di launch o attach attendono fino a configurationDone, initialized viene inviato nel punto appropriato e le richieste launch/attach sovrapposte vengono rifiutate.

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

Valutazione

Stack tecnologico
csharp
Ambito
devtools
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.