microsoft / microsoft/vscode-java-debug

Feature request: Allow reference to previous expression evaluations in debug console

Open
#579 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

evaluation feature request
Dominant language
TypeScript
Stars
591
Forks
429
Avg merge
1d 9h
Merged PRs (30d)
19

Description

It's often generally useful to be able to refer to the results of an earlier expression when exploring the state of a program. This is related to #281, but different. And possibly possible to implement.

result.getBlob("details")
> JDBCBlobClient (id=108)
result.getBlob("details").toString()
> "org.hsqldb.jdbc.JDBCBlobClient@63611043" (id=111)
Utils.fromJson(result.getBlob("details").getBinaryStream())
> BuildRequest (id=119)

This could be changed to

result.getBlob("details")
> JDBCBlobClient ($id_108)
$id_108.toString()
> "org.hsqldb.jdbc.JDBCBlobClient@63611043" ($id_111)
Utils.fromJson($id_108.getBinaryStream())
> BuildRequest ($id_119)

This would allow exploring the results from calls where repeating the call would return different results, and would also allow use of APIs that require objects as parameters, for example,

new byte[10000]
> byte[10000] ($id_120)
result.getBlob("details").getBinaryStream().read($id_120, 0, 10000)
> 200
new String($id_120)
> "The string result is displayed here..."

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.

Research direction

Start at the debug console entry point and examine how expressions are evaluated and displayed. Define how previous results receive references such as $id_108 and how those references can be passed into later expressions; done means results can be reused without repeating calls, including as object or array arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.