Age | Commit message (Collapse) | Author |
|
|
|
This breaking change should make it significantly easier to modify formatters. While I expect 99% of configs to be backwards-compatible, this can still potentially cause problems. If you:
* define a formatter in the `formatters` option
* that has the same name as a built-in formatter
* and omits a property from the original formatter (e.g. leaves out `range_args` or `cwd`)
Then you may encounter breaking behavior from this commit, because now your config definition will be merged with the built-in definition, and so will inherit those omitted properties. This config merging behavior can be opted-out of by adding `inherit = false` to your formatter config.
|
|
|
|
|
|
|
|
When lsp_fallback = true AND the only formatters for the buffer are from
the "*" or "_" filetype, format with LSP instead of the "*"/"_"
formatters.
|
|
|
|
|
|
|
|
|
|
|
|
Alternations are now supported. You can specify a sub-list in place of a
formatter name and conform will use the first formatter in that list
that is available. For example, this will use either prettierd or
prettier (whichever is available), and then always trim whitespace
afterwards:
conform.format(formatters = { { "prettierd", "prettier" }, "trim_whitespace" })
This syntax is available both in the formatters_by_ft config option and
in the `formatters` argument of the `format` method.
|
|
run_all_formatters is now the default. To only run the first formatter
(the previous behavior), see the next commit
|
|
|
|
|
|
* fix readme error and add a tip
* fix doc `prettier_d`
|
|
* refactor: replicate lsp.buf.format call
* feat: format() takes an optional callback
* fix: improper logging
* fix: callback returns error if buffer is no longer valid
* fix: provide more detailed error message to callback
* fix: properly detect task interruption
* cleanup: remove unnecessary error code translation
* fix: lsp formatting for Neovim 0.9
* doc: add example of async formatting on save
* fix: async LSP formatter discards changes if buffer was modified
* fix: error code comparison
* fix: use the same LSP client filtering logic everywhere
* fix: add buffer validity guard checks
* fix: add buffer validity guard to LSP formatter
* refactor: change the default log level to WARN
|
|
I realized that there are so, so many possible features people would
want when configuring the autoformatter, but it's better to just code it
up yourself rather than try to create a config language that can
describe all possible logic. Also adding new docs to provide examples of
more advanced autoformat logic.
|
|
|