Please forgive the late mid-thread reply; I was on the road. 

On Tue, May 10, 2022 at 1:56 PM Yuan Fu <casouri@gmail.com> wrote:
Yeah using a single cache would probably result in a lot of misses since Emacs don’t fontify the whole buffer at once. 

While it's true that Emacs doesn't fontify whole buffers under the current scheme, based on what I've read of tree-sitter (caveat: a fairly long while back), I think it might be reasonable to move to a whole-buffer-and-repair strategy for emacs+treesit, and that might provide some nice simplification along the way. Is there a good way to try this strategy now? I avoid JS whenever possible, and that seems like it might be the current-best test case...

Thanks,
~Chad