-
Notifications
You must be signed in to change notification settings - Fork 163
Support lazy loading object values from toString() #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...ore/src/main/java/com/microsoft/java/debug/core/adapter/handler/VariablesRequestHandler.java
Outdated
Show resolved
Hide resolved
@@ -94,6 +95,24 @@ | |||
} | |||
|
|||
VariableProxy containerNode = (VariableProxy) container; | |||
|
|||
if (containerNode.getReferencedVariableId() != null && DebugSettings.getCurrent().showToString) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to extract the following block to a private method like resolveLazyValue(variable)
for more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in c8366d5
....debug.core/src/main/java/com/microsoft/java/debug/core/adapter/variables/VariableProxy.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/com/microsoft/java/debug/core/adapter/handler/VariablesRequestHandler.java
Outdated
Show resolved
Hide resolved
String valueString = variableFormatter.valueToString(variable, options); | ||
String detailString = VariableDetailUtils.formatDetailsValue(variable, containerNode.getThread(), variableFormatter, options, | ||
evaluationEngine); | ||
return new Types.Variable("", valueString + " " + detailString, "", referenceId, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the latest commit works.
Is it somehow possible to disable this? I now have to do a lot of clicks to view the desired information during debugging... |
@beckermarc you can set configuration |
Thanks. However that seems to disable the whole feature. I'd prefer to only disable the lazy loading. Is that also possible? |
@testforstephen any comments? |
Make sense to have a setting to turn it off. |
yes, it would be better to display the class name during lazy loading. This is an improvement we also reported back to VS Code core team. microsoft/vscode#135147 (comment) |
cool, thanks for your work! |
Please include an option to disable the lazy loading and return to the old method of displaying variable values. With this addition debugging has become very painful. |
VS Code has added a setting |
FYI. The latest VS Code 1.67.0 has provided a setting |
requires: microsoft/vscode-java-debug#1134
specification: https://microsoft.github.io/debug-adapter-protocol/specification#Types_VariablePresentationHint
demo:
more details can be found in microsoft/vscode#135147, and there is still a UX discussion.