Open the-mikedavis opened 9 months ago
The assumption at the moment is if you have installed an external formatter it is because you want to use it rather than the language server. That does make sense, and therefor this is a big change.
If you make it the default to prefer the language server formatter regardless, then it would also make sense to load up the defaults with all the best external formatters too, then people could easily choose between them by adding the except-features
to choose the external. For example, as a default, adding Prettier as an external formatter for all the languages it can handle.
In languages.toml
, if I specify a formatter, than I obviously expect it to apply immediately, and not only after also looking up and specifying the default LSP and disabling it's formatter.
Auto-formatting currently prefers external formatters to language servers:
https://github.com/helix-editor/helix/blob/0975d9c5e7e4caf08d1c1204f09ab6d2f718105d/helix-view/src/document.rs#L725-L815
But I believe this should be reversed: the language server is probably more efficient than us shelling out to the formatter and computing the diff ourselves.
If one wants to prefer the formatter to the language server formatting they can turn off the formatting feature for that language server using
only-features
/except-features
(https://docs.helix-editor.com/languages.html#configuring-language-servers-for-a-language).