typescript.el icon indicating copy to clipboard operation
typescript.el copied to clipboard

Freeze on indenting dot after comma

Open robgssp opened this issue 2 years ago • 1 comments

I hit this while reformatting. Minimal repro:

,
  .a

Reindenting the second line in typescript-mode freezes emacs.

Emacs 28.1, typescript-mode 20220617.1901

robgssp avatar Jun 23 '22 00:06 robgssp

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.

josteink avatar Jun 24 '22 08:06 josteink