Hmm... This `put-text-property` can't be right.
Can you trace `font-lock-fontify-region` and
`font-lock-default-fontify-region` to check that they correctly return
the proper (extended) bounds of the region they (re)fontified?
BTW, using the extend-region-function isn't ideal: this is meant for
things which can't be refontified separately, so if a change in the
buffer causes notification to make changes over a large portion of the
buffer we'll end up (re)fontified *right away* that whole large
portion even if only a small part (or even no part at all) is displayed.
IOW, it'd be better to mark the changed chunks with this
`put-text-property`, but to do it before jit&font-lock get triggered.
Basically, we'd like to call it from `after-change-functions`, but this
can be called *many* times within a single command, so we want to delay
it. So we can probably just set a flag that says "there are unprocessed
changes" and then sprinkle calls to a "lazy update" function which
checks this flag before calling `treesit--font-lock-notifier` (or
something similar).