]> git.eshelyaron.com Git - emacs.git/commit
Add new TypeScript mode tsx-ts-mode
authorTheodor Thornhill <theo@thornhill.no>
Tue, 29 Nov 2022 20:39:38 +0000 (21:39 +0100)
committerYuan Fu <casouri@gmail.com>
Fri, 2 Dec 2022 04:41:57 +0000 (20:41 -0800)
commit1aa1f8432b085305f0f46c42a9054987ac9afc2a
tree371585fed9fd5127f5f859c830270697bebe0f53
parentad0563855fab51c4d40d48ea9fe1ee36e69b29bf
Add new TypeScript mode tsx-ts-mode

There are in fact two languages supporting TypeScript for tree-sitter.
Because TSX causes some ambiguities with types there are two grammars,
one called typescript and one called tsx.  To account for this and to
be as correct as possible we enable using both.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Change to a function to accomodate
the two languages.
(typescript-ts-mode--font-lock-settings): Change to a function to
accomodate the two languages.
(typescript-ts-base-mode): Parent mode for typescript-ts-mode
and tsx-ts-mode.
(typescript-ts-mode): Derive from typescript-ts-base-mode and
extend with language specific settings
(tsx-ts-mode): New major mode that derives from
typescript-ts-base-mode and extend it with language specific
settings

Add autoload cookies for the respective file type extensions: .ts and
.tsx.

* etc/NEWS: Mention the new mode.
etc/NEWS
lisp/progmodes/typescript-ts-mode.el