-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Inline values provider isn't called with new view port when scrolling editor content #119559
Comments
@isidorn thanks, the fix works great. Initially I thought that the viewport passed to the inline provider is a bit off, but then I noticed that I'm passing With With Of course that only helps if scrolling stays within the "PlusViewportAboveBelow" area. For page wise scrolling it won't help. |
@weinand thanks for the gifs, they show the two strategies quite well. |
One concern regarding dynamic viewport updates is that it may cause a large number of inline value requests while scrolling the editor. Considering that Java debugger does not support canceling requests, this may impose an additional performance cost on the debugger. For most cases, the method where the stack frame is located should not be very long, and it's fast to return all results to VS Code directly. But with the latest approach, if I scroll the editor, it keeps triggering the InlineValuesProvider. this can lead to a lot of unnecessary repeated calculations. I was wondering if we could introduce a mechanism to control whether or not the inline values need to be refreshed when the viewport changes. For example, allow the InlineValuesProvider to return an "incomplete" flag. If "incomplete" is false, then there is no need to ask for inlineValues again on scroll. but if true, then re-trigger the InlineValuesProvider on scroll. |
@testforstephen please note that we debounce this call. So we only call the provider only once the user stops scrolling. |
Yes, I tried it in Java debugger and debounce is taking effect. It's not the debounce I'm worried about, it's the fact that the inline values returned are volatile and not cached. As I scrolled up and down in the editor, new requests kept coming and I had to recalculate the same lines again. Here is an example. In the very first window, the inline values in the stack frame are fully displayed, then scrolling down and back, the previous results are lost and I have to recalculate the results again. Ideally, it should be like lazy loading. I would prefer not to refresh the view again if the results have been provided before. Screen.Recording.2021-04-08.at.15.50.56.mov |
@testforstephen thanks for the details. |
@testforstephen thanks this is helpful! |
from #105690 (comment)
DebugEditorContribution.updateInlineValueDecorations
needs only be called when a provider is registered. The built-in fallback solution does not need to be called on scrolling because it does not try to only show inline values for the visible area.The text was updated successfully, but these errors were encountered: