Age | Commit message (Collapse) | Author | |
---|---|---|---|
2023-11-06 | fix: nonzero exit code on :wq (#176) | Steven Arcangeli | |
2023-11-04 | feat: allow formatters_by_ft to be a function (#174) | Steven Arcangeli | |
2023-10-26 | fix(formatexpr): use default formatexpr if no formatters or LSP clients (#55) | Steven Arcangeli | |
2023-10-15 | feat!: merge configs in conform.formatters with defaults (#140) | Steven Arcangeli | |
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. | |||
2023-10-10 | fix: prevent format-after-save autocmd from running on invalid buffers | Steven Arcangeli | |
2023-10-10 | fix: prevent format-on-save autocmd from running on invalid buffers (#128) | Chris Bell | |
2023-10-08 | feat: errors do not stop formatting early | Steven Arcangeli | |
2023-10-05 | feat: expose configuration options for injected formatter (#118) | Steven Arcangeli | |
2023-10-02 | fix: format on save autocmds ignore nonstandard buffers | Steven Arcangeli | |
2023-10-02 | fix: injected formatter doesn't have interruption errors | Steven Arcangeli | |
2023-10-02 | fix: error handling for injected formatter | Steven Arcangeli | |
2023-09-29 | fix: alternations follow notification rules | Steven Arcangeli | |
2023-09-29 | feat: format injected languages (#83) | Steven Arcangeli | |
2023-09-29 | fix: format_after_save autocmd blocks nvim exit until complete | Steven Arcangeli | |
This fixes one the main issue with a BufWritePost format autocmd: that if the user does `:wq` vim will exit before the formatting changes are applied. Now we will block in VimLeavePre until the formatter completes (or a timeout is reached). | |||
2023-09-29 | fix: only show "no formatters" warning if formatters passed in explicitly (#85) | Steven Arcangeli | |
2023-09-21 | refactor: rename ruff -> ruff_fix | Steven Arcangeli | |
2023-09-19 | fix: range formatting for LSP formatters (#63) | Steven Arcangeli | |
2023-09-18 | doc: remove irrelevant note about '*' filetype | Steven Arcangeli | |
2023-09-17 | feat: make lsp_fallback behavior more intuitive (#59) | Steven Arcangeli | |
When lsp_fallback = true AND the only formatters for the buffer are from the "*" or "_" filetype, format with LSP instead of the "*"/"_" formatters. | |||
2023-09-15 | feat: '_' filetype to define fallback formatters | Steven Arcangeli | |
2023-09-15 | feat: provide a formatexpr (#55) | Steven Arcangeli | |
2023-09-15 | feat: allow running commands in a shell (#49) | Steven Arcangeli | |
2023-09-15 | feat: format_on_save functions can return a callback as the second value | Steven Arcangeli | |
2023-09-14 | doc: add some recipes to the documentation | Steven Arcangeli | |
2023-09-13 | doc: document the format options that are passed through to LSP formatting | Steven Arcangeli | |
2023-09-10 | feat: format_on_save and format_after_save can be functions | Steven Arcangeli | |
2023-09-08 | feat: format() can always fall back to LSP formatting | Steven Arcangeli | |
2023-09-08 | feat: syntax for using first available formatter | Steven Arcangeli | |
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. | |||
2023-09-07 | refactor!: remove run_all_formatters config option | Steven Arcangeli | |
run_all_formatters is now the default. To only run the first formatter (the previous behavior), see the next commit | |||
2023-09-07 | refactor: make get_formatter_info a public method | Steven Arcangeli | |
2023-08-31 | fix: callback should always be called | Steven Arcangeli | |
2023-08-31 | feat: format() takes an optional callback (#21) | Steven Arcangeli | |
* 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 | |||
2023-08-30 | feat: apply changes as text edits using LSP utils (#18) | Steven Arcangeli | |
* 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. | |||
2023-08-29 | feat: notify when formatter errors, and add notify_on_error config option (#16) | Steven Arcangeli | |
2023-08-29 | feat: formatter config function is passed the buffer number (#9) | Steven Arcangeli | |
2023-08-29 | feat: add support for environment variables (#8) | Steven Arcangeli | |
2023-08-28 | feat: ConformInfo command for debugging formatter status | Steven Arcangeli | |
2023-08-28 | feat: range formatting | Steven Arcangeli | |
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. | |||
2023-08-28 | fix: stable ordering when specifying multiple formatters | Steven Arcangeli | |
2023-08-28 | refactor!: remove ability for formatter list to disable autoformat | Steven Arcangeli | |
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. | |||
2023-08-28 | fix: don't show 'no formatters' warning if none configured | Steven Arcangeli | |
2023-08-28 | feat: can silence notification when running formatters (#7) | Steven Arcangeli | |
2023-08-28 | fix: remove unnecessary notify | Steven Arcangeli | |
2023-08-27 | fix: keep window position stable when LSP formatting | Steven Arcangeli | |
2023-08-27 | lint: fix type annotations | Steven Arcangeli | |
2023-08-27 | doc: flesh out config options documentation | Steven Arcangeli | |
2023-08-27 | test: add a test suite | Steven Arcangeli | |
2023-08-25 | fix: notification when no formatters available | Steven Arcangeli | |
2023-08-25 | feat: first working version | Steven Arcangeli | |