stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
3.02k stars 156 forks source link

bash file type not resolved correctly for shfmt #424

Closed trkwyk closed 4 months ago

trkwyk commented 4 months ago

First of all thank you for the great plugin particularly after null-ls having been archived! I ran into the same issue mentioned in #379 with bash (change it into sh in formatters_by_ft does the trick). I think it's a bit misleading to use language names instead of file extensions in the README example if that's not intended. However, if that is the best practice, shouldn't there be a table to maintain the mappings which I didn't find? Seems the lang_to_ext is for formatter injected particularly. It's not the default table. If there is such a table mapping, could anyone enlighten me where is it?

trkwyk commented 4 months ago

After a bit of research it seems it follows the filetype api of Neovim, which returns sh instead of bash for bash scripts if not forcing the bash file type manually fyi. The examples in README are correct e.g. :set ft? in a python file returns python.