Preserve lazy hover state across document switches - #207
Merged
Conversation
jdalton
force-pushed
the
perf/lazy-hover
branch
5 times, most recently
from
September 7, 2026 15:02
28f0c22 to
7f8fc69
Compare
jdalton
force-pushed
the
perf/lazy-hover
branch
from
September 7, 2026 15:05
7f8fc69 to
06b2a07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After an engine queries a second document, hover events from the first document can overwrite the active document's state. Keep lazy hover tracking per document, restore that state on document switches, and read native hover state that predates listener setup.
Use weak document records when WeakMap is available. Legacy hosts retain only the current document's record and reuse stable callbacks to avoid duplicate listeners. Preserve the lazy-registration and repeated-query assertions from #209, and add host-state, document-switching, background-event, and legacy-host regressions. The browser manifest retains the existing compound-negation fixture.
Validation after rebasing onto #206: 557 Node tests, 19 focused hover/descendant tests, and 56 browser tests pass. Formatting, lint, types, repository checks, and combined coverage pass. Combined coverage is 85.02% statements, 75.64% branches, 84.39% functions, and 83.83% lines. The packed-package check passed 22 tests before the rebase.