GNU bug report logs -
#68054
[PATCH] Add tree-sitter indent rule for lexical decls in js/typescript
Previous Next
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
View this message in rfc822 format
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.