Modern Tree-sitter, part 4: indentation and code folding

Open link in next tab

Modern Tree-sitter, part 4: indentation and code folding |

https://pulsar-edit.dev/blog/20231031-savetheclocktower-modern-tree-sitter-part-4.html

A Community-led Hyper-Hackable Text Editor

Last time we looked at Tree-sitter’s query system and showed how it can be used to make a syntax highlighting engine in Pulsar. But syntax highlighting is simply the most visible of the various tasks that a language package performs.

Today we’ll look at two other systems — indentation hinting and code folding — and I’ll explain how queries can be used to support each one.