ecosse3 / nvim

A non-minimal Neovim config built to work most efficiently with Frontend Development
GNU General Public License v3.0
1.25k stars 110 forks source link

[BUG] TypeScript Format Document #43

Closed willdavidow closed 2 years ago

willdavidow commented 2 years ago

When running a format document command, that is gg=G, it completely blows up the formatting TypeScript files. I use this command pretty often to make sure formatting is "good" with JavaScript before committing code, but it's basically unusable in any project that uses TypeScript.

I'm not sure if this is a bug with neovim, the tsserver language server, or another plugin that is in-use within Ecovim, but it renders document formatting unusable in the context of anything-TypeScript.

Here's an example video of me formatting one of the files coming out of a remix framework base install using the indie-stack template (https://remix.run/docs/en/v1/tutorials/blog#creating-the-project)

https://user-images.githubusercontent.com/763985/167233669-74a0982f-a7f7-485a-9062-114a752381a3.mp4

ecosse3 commented 2 years ago

Thank you for the issue. It was caused by indent disabled by treesitter, so neovim was using its core indent method which doesn't work well for TSX. It's fixed now.