Granularity of incremental parsing

That’s correct. It’ll reuse Tree objects, but any TreeBuffer touched by the changes is going to be re-parsed.

There’s no way to associate data with nodes inside TreeBuffers in any case, since there’s no object identity for those.

Caching on the Tree level still works very well though (see for example the way local variable completion works in packages like lang-javascript), on the assumption that recomputing for a couple of buffer’s worth of code is cheap enough.

1 Like