Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

debug: Display nested content in the variables pane - #2198

Merged
Ramya Rao (ramya-rao-a) merged 6 commits into
microsoft:masterfrom
jhendrixMSFT:debugger1010
Jan 28, 2019
Merged

debug: Display nested content in the variables pane#2198
Ramya Rao (ramya-rao-a) merged 6 commits into
microsoft:masterfrom
jhendrixMSFT:debugger1010

Conversation

@jhendrixMSFT

Copy link
Copy Markdown
Member

If a variable contains children but they have not been loaded issue an
expression command to delve to fetch them, then update the variable's
children array with the result. This required refactoring the
evaluateRequest method into two parts so that delve expressions can be
evaluated synchronously.
Removed unreferenced param in convertDebugVariableToProtocolVariable.

@jhendrixMSFT

Copy link
Copy Markdown
Member Author

Fixes #1010

Comment thread src/debugAdapter/goDebug.ts Outdated
Comment thread src/debugAdapter/goDebug.ts
Comment thread src/debugAdapter/goDebug.ts Outdated
Comment thread src/debugAdapter/goDebug.ts Outdated
Comment thread src/debugAdapter/goDebug.ts Outdated
Comment thread src/debugAdapter/goDebug.ts
Comment thread src/debugAdapter/goDebug.ts Outdated
Comment thread src/debugAdapter/goDebug.ts Outdated
If a variable contains children but they have not been loaded issue an
expression command to delve to fetch them, then update the variable's
children array with the result. This required refactoring the
evaluateRequest method into two parts so that delve expressions can be
evaluated synchronously.
Removed unreferenced param in convertDebugVariableToProtocolVariable.
@jhendrixMSFT

Copy link
Copy Markdown
Member Author

Ramya Rao (@ramya-rao-a) FYI

@ramya-rao-a

Copy link
Copy Markdown
Contributor

Joel Hendrix (@jhendrixMSFT) Great job! I have 2 main concerns here

  • We are now sending parallel requests to delve to evaluate contents of the array. Do we know if delve is able to handle concurrent requests like this?
  • These requests to delve will be sent even if there is nothing to expand. For example, take an array of strings. When the user expands that variable, the evaluate request will be sent of each string in the array. Can we somehow not send these requests based on the type of the array or map value?

@jhendrixMSFT

Copy link
Copy Markdown
Member Author

Ramya Rao (@ramya-rao-a) are the requests in parallel? My intention was to perform them synchronously. Good point on the spurious evaluations on strings, I will update loadChildren() to never perform the eval if the type is string.

Log error if evaluation fails.
@jhendrixMSFT Joel Hendrix (jhendrixMSFT) changed the title Display nested content in the variables pane debug: Display nested content in the variables pane Jan 23, 2019
@ramya-rao-a

Copy link
Copy Markdown
Contributor

Good point on the spurious evaluations on strings, I will update loadChildren() to never perform the eval if the type is string.

Its not just when the variable itself is a string. This also applies to array of strings, numbers or any of the primitive types. These would not need further evaluations.
Same applies to maps. When the value in the key/value pair of the map is a simple string or number or other primitive type, we dont need further evaluation.

@jhendrixMSFT

Copy link
Copy Markdown
Member Author

I found a great description of when to load children here. Will update based on this spec.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants