-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
[Debug] Allow to list variables asynchronously #135147
Comments
This feature is somewhat similar to #134450 |
Kind of related to the way that the variables pane doesn't update when I modify a variable in the debug console, but the runtime might know that it was updated. I think there was a request for that at some point. |
@testforstephen the somewhat related request #134450 asks for making additional information available via an explicit UI element and gesture. So a VS Code could show an ellipsis ( Would this approach still address your problem? |
Yes, my issue is similar to #134450. The proposal you mentioned seems more feasible and can solve my problem. One concern is how does the user aware of |
@testforstephen great, then let's first tackle #134450 and if that turns out to be not a good solution for your case, then we can work on "asynchronous variable updates". |
@testforstephen the February release has a first cut of a "lazy variables" feature. It would be great if you could try this for Java and provide feedback. What you have to do is explained here. |
@weinand Sure, let me play a little. thank you for your excellent work. |
@weinand I just tried the feature, and it works great!👍 And I just notice that if
here, instead of
It would be great to show more thing we can get to the users. |
@CsCherrYY yes, your proposal to show the @DanTup @roblourens @connor4312 what do you think? |
Sounds reasonable to me too. I haven't gotten to testing this out yet, though there's probably some useful info we could show in Dart before evaluating (for example the static type). I presume this would be optional though, and it's possible to just have the ellipsis too. |
@DanTup the
|
Yes, showing the getter's source as the value would result in too much noise. But since the @connor4312 what do you think? |
I'm not a fan of the proposal to show the Displaying the value as a suffix after |
@CsCherrYY @DanTup what do you think about @connor4312's idea to show the value as a suffix? |
And if it matters, we probably plan to replace the |
Sorry I don't follow, what is the screenshot showing? |
Sorry for not being clear. The variable screenshot is from other IDE, I use it to demo how it might look like to show a |
hi @weinand , I have another problem when implementing this. Since there are two requests on resolving the lazy variable, I found it's hard for us to distinguish which request is for lazy resolving and which request is for resolving children. We just used a flag to mark if this variable needs to be lazy resolved. if this flag is But if we add something to the watch view or the debug console panel, all the lazy variables in the |
@CsCherrYY using state ("a flag") on your backend variable is calling for trouble. Don't do this. I suggest to introduce an intermediate object instead:
With this approach no state is needed and sync issues are impossible. Please note that the "intermediate object" approach was our recommendation already before we introduced "lazy" variables last month. Previously the "intermediate object" was just visible in the UI (which was a bit confusing). If you want to make sure that your new implementation works in old versions of VS Code (which don't support "lazy" variables), I suggest that you disable the "lazy" flag on the DAP |
Sorry, I missed this before. I agree that a suffix would look better in the collapsed form:
In the expanded form, does it remain there? eg.:
|
@weinand thanks for the detail clarification and guidance! I'll have a try and verify it |
Hey @weinand, we have just released the lazy variables feature in Java Debugger, and want to share some user feedbacks on the lazy variable user experience.
|
@testforstephen thanks a lot for trying lazy variables and providing very helpful feedback! To address items 1+2 I think we should start showing the value of the lazy item as a suffix of the "(...)", e.g.:
After expanding (clicking) the '(...)', both the (...) and the suffix are replaced by the expanded value. Item 3 is already planned for April: #144861 In addition, as suggested by @testforstephen above we should use a "separate UI element" (an icon) instead of the "(...)". Please see #143602: |
Pushed a change to show the value next to the new icon. I think that is the only issue here that is not covered by another issue. |
@connor4312 if you want to make any changes here for js-debug you can do that and verify this |
Use Case:
In Java Debugger, we have added some features to display some additional information about object variables. For example, displaying info about the size of a collection, and displaying the toString value of a class that overrides the toString() method. A side effect is that these properties require some extra calculation in the debuggee to get them , and can be slow on some large objects. In particular, getting the toString value of a large object can be very slow. Currently, variable responses must be returned in a single request, and in some bad cases, the user could wait for a long time to get the variables being displayed in Variables view.
One idea is to support listing variables asynchronously. For example, in a Variables response, we could first return the basic variable properties and display some placeholders (e.g. loading...) for those that are not yet ready. Once the debugger gets them, use some event (e.g. refreshVariableEvent) to notify the client to refresh a node.
The text was updated successfully, but these errors were encountered: