PowerShell / PowerShell/PowerShellEditorServices

Bring launch sequencing in line with DAP spec

オープン
#2,191 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Issue-Enhancement
主要言語
C#
スター
767
フォーク
266
平均マージ
3日 16時間
マージ済み PR(30日)
1

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、DAP の launch/attach および configurationDone ハンドラーを特定し、そのシーケンスを引用されている DAP 仕様と比較します。現在、launch tasks と responses がどのように完了されているかを追跡します。完了とは、launch または attach の responses が configurationDone まで待機し、適切な時点で initialized が送信され、重複する launch/attach リクエストが拒否されることを意味します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
devtools
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。