emacs-typescript / typescript.el

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

interface ar not properly indented with typescript-ts-mode #190

Closed YievCkim closed 3 months ago

YievCkim commented 3 months ago

I am on emacs 29 with treesitter enabled.

on typescript-mode interface is indented as expected like this:

export interface Consumer {
  email: string
}

but with typescript-ts-mode no indentation is added into the interface:

export interface Consumer {
email: string
}

It's too bad because color highlighting is better in this mode.

josteink commented 3 months ago

I just checked the keybindings I have for my personal setup, vs emacs loaded with --no-init-file.

It seems somewhere in my init-file I've bound RET to newline-and-indent (probably for all prog-modes) and then you get the behaviour you want.

Unfortunately, the default for typescript-ts-mode is just that RET is bound to newline.

We should fix this upstream in Emacs, but in the meantime you can work around that bug by adding that binding manually in your init file.

YievCkim commented 3 months ago

Hello @josteink thank you for the trick.

I didn't realize that typescript-ts-mode was provided directly by emacs (Correct me If I am wrong) In fact a fix has been made along these lines. But despite what is indicated in the report, it does not yet seem to be available on version 29.3.

I hope to see it soon (I am using emacs from a nix package, I guess 29.4 will come soon).

I went back to classic typescript-mode but I will try newline-and-indent tomorrow I think.

Thanks again.

YievCkim commented 3 months ago

I have to indicate in the (emacs) bug report the missing fix announced in 29.3, too. I will do that tomorrow.

josteink commented 3 months ago

Yes typescript-ts-mode is now a core part of Emacs. Yay!

I'm on vacation now, but just to remind myself to get this fixed later, I registered a bug for this particular aspect here:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72184