Age | Commit message (Collapse) | Author |
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
New config syntax for "run first" vs "run all"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
skip-checks: true
|
|
* feat: add beautysh
* feat: add taplo
* feat: add trim_newlines
* feat: add trim_whitespace
* doc: mention that `trim_newlines` and `trim_whitespaces` are using `awk`
---------
Co-authored-by: xfzv <>
|
|
|
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
|
|
skip-checks: true
|
|
|
|
skip-checks: true
|
|
* fix readme error and add a tip
* fix doc `prettier_d`
|
|
|
|
|
|
* ci: don't double-run tests on PRs
* ci: always run document generation and lint
|
|
|
|
* 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
|
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
* feat: apply changes as text edits using LSP utils
This means we can leverage all of the work that was done in the LSP
client to preserve marks, cursor position, etc
* log: add trace logging to debug performance
* feat: use the same diff -> TextEdit technique for bad LSP servers
Some LSP servers simply return a single TextEdit that replaces the whole
buffer. This is bad for extmarks, cursor, and if the buffer is open in
multiple windows the non-active window will jump to the top. We can
detect that situation and apply the same vim.diff logic to convert it
into more granular TextEdits.
|
|
|
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
skip-checks: true
|
|
|
|
|
|
|
|
skip-checks: true
|
|
|
|
skip-checks: true
|
|
|
|
skip-checks: true
|
|
|
|
skip-checks: true
|
|
|
|
|
|
|
|
|
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
|
|
|
|
Should work the same as vim.lsp.buf.format(). Additionally, range
formatting is supported for *any* formatter. If the formatter doesn't
have native support for ranges, conform will do its best to only apply the
diffs that affect that range.
|
|
|
|
|
|
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.
|
|
skip-checks: true
|