GNU bug report logs - #68054
[PATCH] Add tree-sitter indent rule for lexical decls in js/typescript

Previous Next

Package: emacs;

Reported by: Noah Peart <noah.v.peart <at> gmail.com>

Date: Wed, 27 Dec 2023 06:22:01 UTC

Severity: wishlist

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #61 received at 68054 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Noah Peart <noah.v.peart <at> gmail.com>
Cc: Yuan Fu <casouri <at> gmail.com>, 68054 <at> debbugs.gnu.org
Subject: Re: bug#68054: [PATCH] Add tree-sitter indent rule for lexical decls
 in js/typescript
Date: Sun, 9 Jun 2024 05:52:47 +0300
On 02/05/2024 16:38, Noah Peart wrote:
>  > js-ts-mode now has the exact same indentation
> 
> I'm not sure what you meant by this - did you mean js-ts-mode has
> the same indentation for non-multivar declarations as the examples
> shown above? js-ts-mode is still missing indentation rules for multiple 
> decl statements.
> The patch would work for js-ts-mode as well, but I didn't want to copy the
> code between the files.

Yes, I meant that it would be a good idea to keep the modes consistent, 
and to keep those examples indent like they do now.

> So much of the grammar is shared between js-ts-mode and
> typescript-ts-mode, it might be worth combining - neovim uses an ecma 
> grammar
> from which they both inherit.

When you say "uses the ecma grammar", what do you mean exactly? It just 
uses the parent grammar, not either of those two?

As for copying the code, it might be fine - the indentation rules are 
difficult to share, and copying the definition of 
typescript-ts-mode--anchor-decl is probably better than loading the 
whole other package file just for its sake. If more functions could be 
reused, however...




This bug report was last modified 191 days ago.

Previous Next


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