News for hackers. Stuff that matters.
Re:Making bracket pair colorization faster by davidkunz on Wednesday September 29, 2021 @09:08AM (#28693064)
Hah, I just wondered how easy it would be to implement it using treesitter, thanks for the link!
Re:Making bracket pair colorization faster by Gehinnn on Wednesday September 29, 2021 @09:17AM (#28693153)
As far as I know though, tree sitter has problems with really long lists and even incremental parsing gets slower linearly when extending the list.

Also, to my knowledge, tree sitter cannot move nodes around (which is also very hard for languages that are not as simple as the Dyck language [1]).

For bracket pairs, you can easily reuse all (...)-pairs in the following example, even though their height in the AST changes significantly: old text: (...)[(...)] new text: {{(...)}(...)}

[1] https://en.wikipedia.org/wiki/Dyck_language