PowerShell / PowerShell/PowerShellEditorServices
Bring launch sequencing in line with DAP spec
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 767
- 派生
- 266
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 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:
- Initialize is sent and server responds, then responds with capabilities
- Launch is sent by client after receiving capabilities. should be held and deferred until configurationDone
- Server sends initialized event (preferably when ready to receive launch requests)
- Client does config after initialized
- Configuration is done (breakpoints etc.)
- launch request is now responded to after configuration is completed
In actuality, we respond to the launch request immediately before configuration
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 DAP 的 launch/attach 和 configurationDone 处理程序,然后将它们的时序与引用的 DAP 规范进行比较。跟踪当前如何完成 launch tasks 和 responses。完成意味着 launch 或 attach responses 会等待到 configurationDone,initialized 会在适当的时间点发送,并且会拒绝重叠的 launch/attach 请求。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100