GNU bug report logs - #74386
Tree-sitter javascript indentation

Previous Next

Package: emacs;

Reported by: Marius Kjeldahl <marius.kjeldahl <at> gmail.com>

Date: Sat, 16 Nov 2024 23:28:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Theodor Thornhill <theo <at> thornhill.no>
To: Yuan Fu <casouri <at> gmail.com>, Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 74386 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, marius.kjeldahl <at> gmail.com
Subject: bug#74386: Tree-sitter javascript indentation
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




This bug report was last modified 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.