microsoft / microsoft/debug-adapter-protocol

Provide a way for variables to be eagerly provided with the output

Open
#85 2 comments 1 reaction 1 assignee View on GitHub

@connor4312 is already working on this.

Since Jan 31, 2023.

feature-request
Dominant language
HTML
Stars
1.8k
Forks
173
Avg merge
7d 7h
Merged PRs (30d)
2

Description

Investigating https://github.com/microsoft/vscode-pwa/issues/161, the call flow is:

  1. The debug adapter receives a log message
  2. It stores variables and tells the client that output was received, passing a variablesReference
  3. The program terminates
  4. The variables are never resolved / output is not shown because the session ended before the client requests the variables

The was not a problem in the previous JS adapter with the given example script simply because there's short circuit logic in the event that we only log a string--but this obviously isn't something that will work for all scenarios.

The clear way I see to solve this would be to allow the debug adapter to eagerly provide the variable reference in the output; I don't think there's really another good way to solve the race above short of holding the session open for some arbitrary period of time expecting that the client might request variables.

Trace of one scenario where this happened, which you can view using the tool.

This would also help solve https://github.com/microsoft/vscode-pwa/issues/122.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.