Skip to content

fix(syntax): cache scope tables by source, and forget answered keys - #108

Merged
seatedro merged 1 commit into
masterfrom
rohit/syntax-scope-cache-key
Nov 3, 2026
Merged

seatedro merged 1 commit into
masterfrom
rohit/syntax-scope-cache-key

Conversation

@seatedro

@seatedro seatedro commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Hunk headers could show enclosing scopes from a different text, because the scope worker cached tables by request key and language only, so a key reused for new source (or the same key from another client) got the first source's table; it also kept an entry for every key ever requested until its client was dropped. Tables are now cached by a hash and length of the source plus its language, and a key's entry is dropped once its newest request is answered.

The scope worker cached tables by request key and language alone, so a
key asked again for another source, or the same key from another
client, got the first source's table: hunk headers could name scopes
from a different text. It also kept the newest generation of every key
ever asked until its client went away, and each revision brings new
keys.

Tables are now cached by a hash and length of the source with its
language, which is all a table depends on. A key's entry goes once its
newest request is answered; a client asks for a key in order, so no
older generation can follow it.
@seatedro seatedro closed this Nov 3, 2026
@seatedro seatedro reopened this Nov 3, 2026
@seatedro
seatedro enabled auto-merge November 3, 2026 12:47
@seatedro
seatedro merged commit 0595209 into master Nov 3, 2026
13 of 15 checks passed
@seatedro
seatedro deleted the rohit/syntax-scope-cache-key branch November 3, 2026 12:58
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