I was looking into how formatters are currently integrated in the library and I’m wondering what the intended design here is.
-
Right now the formatter seems effectively tied to the language instance (Language.formatter / LspLanguage.setFormatter). When using language servers the normal language formatter gets overridden by the LSP connection logic (LspFormatter). This makes it difficult to reliably provide a custom formatter.
-
There also doesn’t seem to be a clear API for swapping formatters at runtime (no dedicated setter).
What was the original idea for how formatter selection and override should work here?
I was looking into how formatters are currently integrated in the library and I’m wondering what the intended design here is.
Right now the formatter seems effectively tied to the language instance (Language.formatter / LspLanguage.setFormatter). When using language servers the normal language formatter gets overridden by the LSP connection logic (LspFormatter). This makes it difficult to reliably provide a custom formatter.
There also doesn’t seem to be a clear API for swapping formatters at runtime (no dedicated setter).
What was the original idea for how formatter selection and override should work here?