emacs-typescript / typescript.el

TypeScript-support for Emacs
GNU General Public License v3.0
266 stars 79 forks source link

Freeze on indenting dot after comma #166

Open robgssp opened 2 years ago

robgssp commented 2 years ago

I hit this while reformatting. Minimal repro:

,
  .a

Reindenting the second line in typescript-mode freezes emacs.

Emacs 28.1, typescript-mode 20220617.1901

josteink commented 2 years ago

Hey there and thanks for the report!

The good news is that I can confirm your easy repro case freezes my Emacs too (until I press CTRL-G). The bad news is typescript.el is kinda "legacy" at this point.

Going forward we're going to be using tree-sitter based-parsing instead of Elisp-based parsing, which is very complicated and involved for grammars like TypeScript.

There was one prototype for that which should be compatible with "any" Emacs-version: typescript-tree-sitter-mode from this very repo (although in a feature-branch).

But going forward native tree-sitter support is going to be added to mainline Emacs, and efforts in writing a major-mode for that has been pioneered by @theothornhill at Sourcehut, although this currently only runs with latest Emacs built from source, branch feature/tree-sitter.

I've tested with both these implementations and none of those have this issue.

As such, I don't think this is going to be fixed in the legacy "Elisp" version.