-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix indefinite line tracker suspension after closing large dirty editor #3067
Fix indefinite line tracker suspension after closing large dirty editor #3067
Conversation
@@ -44,6 +44,7 @@ export class LineTracker<T> implements Disposable { | |||
this._selections = toLineSelections(editor?.selections); | |||
|
|||
this.notifyLinesChanged('editor'); | |||
this.onActiveEditorChanged?.(); |
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 was brainstorming a few alternatives to this approach.
- Instead of the indirection through
GitLineTracker
, we could also callthis.resume()
right here. That felt strange since nothing else inlineTracker.ts
suspends or resumes the tracker. This feels like agitLineTracker.ts
responsibility based on what's written today. - We could call
this.fireDocumentDirtyStateChanged
in thewindow.onDidChangeActiveTextEditor
handler. This feels like a reasonable alternative approach to me. The main downside is that it's a bit of a slippery slope with regard to what document-specific change events are re-fired when the active editor changes. Ex: Would we also want to callonBlameStateChanged
when the active editor changes?
I settled on the current approach, but happy to consider others in more depth if others have thoughts.
67ac10e
to
594c0a0
Compare
TestingHere's a test double checking that the original issue is fixed. A video of the original bug is present in #3066. Fixed.mov |
I found it surprising that the One idea would be to show an hourglass similar to what GitLens currently does as you move between lines. On hover, the indicator would show why it's delaying blame computation with a suggestion to tweak |
This comment was marked as spam.
This comment was marked as spam.
Thank you so much for your contribution here! Great investigation work and resolution! I've merged this directly, but I will be making some further changes to unify the LineTracker and GitLineTracker (no real need for the separation at this point), and will look into some kind of "notification" statusbar or something to let the user know why things are suspended and be able to point them to changing values to tweak it if you want more responsiveness and can spare the extra compute overhead |
Thanks so much for reviewing this! Further changes post-merge are all welcome. I appreciate you taking the time to consider my thoughts. |
Refactored things a bit here: And added the following when the delay is active -- clicking on the link will jump to the setting in the settings UI And this when the file is over the threshold -- clicking on the link will jump to the setting in the settings UI FYI, the default delay is |
That looks fantastic! Love it. |
Description
Fixes #3066. See issue link for an in-depth explanation of the bug, steps to reproduce, and a video.
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses