How does one use local treesit parsers/multiple parsers to fontify different regions in a buffer? I haven't been able to find any tree-sitter modes that are currently using local parsers to see how it is supposed to work.
According to treesit-local-parsers-on, if I'm reading it correctly, I should be able to specify local parsers by adding a treesit-parser property to an overlay. The doc also says the local parsers should have an embedded tag. So, I've tried doing that, eg. in a dockerfile-ts-mode buffer
RUN \ # comment echo foo \ bar Adding an overlay with a treesit-parser for bash to the body of the RUN command (with region selected),
(let ((ov (make-overlay (region-beginning) (region-end)))) (overlay-put ov 'treesit-parser (treesit-parser-create 'bash nil nil 'embedded))) But, I'm not sure what to do next - calling treesit-font-lock-fontify-region doesn't seem to do anything with the bash parser.
Anyone know how to get multiple parsers working together? And if so, is there a way to specify regions to be injected with local parsers in the treesit-font-lock-rules?
[[it looks like nvim-treesitter has a nice mechanism to handle this]]