Skip to content
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

Re-Apply Lazy load stack frame information #108

Merged
merged 8 commits into from
Feb 5, 2025

Conversation

RemcoSmitsDev
Copy link
Owner

@RemcoSmitsDev RemcoSmitsDev commented Feb 5, 2025

This PR re-applies #106:

This PR changes when we fetch scopes & variables for a stack frame. Before this change, we would always fetch all the scopes & top level variables for all the stack frames. But this leads to a slow experience when you have a debug session that has a lot of stack frames. Not only that, but for example the JavaScript debugger allows you to visually skip stack frames, which why it does not make sense to fetch the scopes and variables for them only when you actually want to see them.

So this PR changes that, we now always only fetch the scopes & variables for the first stack frame and when a user selects a stack frame for the first time we will fetch the information after that we will only rebuild the visual entries everytime.


This PR fixes the following things:

  • Correctly invalidate variables when you use setVariable or evaluate requests.
  • Keep open entries (variables) when you are step debugging (broken after adding scope_id to OpenEntry enum).
  • Don't fetch scopes & variables for first stack frame twice.

TODO's

  • Fix infinite loop with collab remote variable toggling

This was introduced by my original PR, because I added the fetch on stack frame select but when the stack frames where updated we would already fetch the initial variables. And when the selectedStackFrameUpdated event was received we would refetch it because it was not done yet.
The issue was the we used the scope_id, which changes after each debug step. So using the name of the scope instead should be more reliable.
@RemcoSmitsDev RemcoSmitsDev marked this pull request as ready for review February 5, 2025 16:41
@RemcoSmitsDev RemcoSmitsDev force-pushed the lazy-load-stack-frame-information branch from 0eee6e6 to df3b209 Compare February 5, 2025 16:42
Also commenting out an event that triggers the infinite loop.

We want to revisited the collab stuff anyway so we decided to do it this way.
@RemcoSmitsDev RemcoSmitsDev force-pushed the lazy-load-stack-frame-information branch from df3b209 to dfd2498 Compare February 5, 2025 16:44
@RemcoSmitsDev RemcoSmitsDev merged commit c76144e into debugger Feb 5, 2025
10 checks passed
@RemcoSmitsDev RemcoSmitsDev deleted the lazy-load-stack-frame-information branch February 5, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant