Open chrisgrieser opened 7 months ago
Heya, I hadn't thought of this because typos is often used with source code, which typically has its own document formatter. So in most cases I would expect the default formatter to be specific to the file type (eg: prettier for javascript). I can't think of a use-case or file type where you would want to use typos instead of a source code formatter?
No, not using typos instead of a source code formatter, but rather using typos in addition to the source code formatter. Not familiar with other editors, but in nvim, when I run vim.lsp.buf.format()
, all attached LSPs that have formatting capability will run their formatting
Ah thanks for the elaboration. You are using nvim. I use vscode which AFAIK doesn't have an "apply all formatters" command, so I wasn't aware this was a thing!
Because of the difference between editors, I don't think I'd want this enabled by default, but I can see a new config option that if set would offer the documentFormattingProvider
. I presume you'd want this enabled for all file types?
Yep, enabling it via setting should be good
Commonly, LSPs provide formatting capabilities (
documentFormattingProvider
).For typos, it could be useful be able to autofix misspellings via LSP-formatting. Essentially what
typos --write-changes
does, only triggered from inside the IDE.