PowerShell / PowerShell/PowerShellEditorServices

Bring launch sequencing in line with DAP spec

Abierto
#2,191 2 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Issue-Enhancement
Lenguaje dominante
C#
Estrellas
767
Forks
266
Merge medio
3 d 16 h
PR fusionados (30 d)
1

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza localizando los handlers de DAP para launch/attach y configurationDone, y compara después su secuenciación con la especificación DAP citada. Sigue cómo se completan actualmente las launch tasks y las responses. Hecho significa que las responses de launch o attach esperan hasta configurationDone, que initialized se envía en el momento adecuado y que se rechazan las solicitudes de launch/attach superpuestas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
devtools
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.