Subject: bug#74386: Tree-sitter javascript indentation

From: Theodor Thornhill <[email-masked]>
Date: Sun, 05 Jan 2025 12:33:10 +0100

>>> I’ve already used it to rewrite c-ts-mode indent rules and it’s been a success; this baseline + override approach has been very helpful. c-ts-mode still has a lot of indent rules because of things like preproc directive, etc, but it’s much more manageable than before.
>>> I don’t know how much it would help modes that has simpler indent rules. Go-ts-mode and rust-ts-mode only has a handful of indent rules, maybe they don’t really need this baseline rule. OTOH Lua and Ruby has more involved indent rules, maybe they can benefit and reduce the number of rules they need to define.
>> 
>> Ruby has different delimiters (do...end or def...end or etc), and the curlies don't do exactly the same job that they do in C. So I'm not sure how feasible it is. A half of the function would be a fit, though.
>
> Right, so I think it’ll still be more helpful than not.
>
> Yuan

I think I like what's suggested here - I'll see if I can make something
like this work in java-ts-mode, which has a standing bug just like the
one mentioned in this report.

Thanks!

Theo