Tree-sitter became more widespread and Emacs took notice and included a bunch of -ts-mode as alternatives to -mode into the core. This is good news and a welcome change, but I have some concerns about the approach.
When I first saw the Tree-sitter talk by Max Brunsfeld I was concerned that the language highlighting “fix” they’re talking about is too much.
The problem is monochromacity. The font lock rules in a lot of the TS modes are… not always thought through. Ramp up python-ts-mode’s font lock level to the maximum and most of everything is dyed the same colour. It’s frustrating and I have had to muck around with treesit-font-lock-feature-list to selectively unpick the chaff from the grist. And it’s not exactly easy changing it either: if you’re new to elisp, or not fluent in the extremely awkward interface for changing this stuff, you’ll have to look up how someone else has done it.
It’s not even customizable, so you can’t just click around and change it either.
The font lock rules in a lot of the TS modes are… not always thought through. Ramp up python-ts-mode’s font lock level to the maximum and most of everything is dyed the same colour.
And then on the other side, people come asking why even when TS is used, highlighting is not “up to par” with VS Code and etc. Then hear about treesit-font-lock-level, ramp it up to the max, and apparently live happily after.
The problem is monochromacity. The font lock rules in a lot of the TS modes are… not always thought through. Ramp up python-ts-mode’s font lock level to the maximum and most of everything is dyed the same colour. It’s frustrating and I have had to muck around with
treesit-font-lock-feature-list
to selectively unpick the chaff from the grist. And it’s not exactly easy changing it either: if you’re new to elisp, or not fluent in the extremely awkward interface for changing this stuff, you’ll have to look up how someone else has done it.It’s not even customizable, so you can’t just click around and change it either.
And then on the other side, people come asking why even when TS is used, highlighting is not “up to par” with VS Code and etc. Then hear about
treesit-font-lock-level
, ramp it up to the max, and apparently live happily after.