summaryrefslogtreecommitdiffstats
path: root/lua/conform/init.lua
AgeCommit message (Collapse)Author
2024-07-19cleanup!: drop support for nvim 0.8Steven Arcangeli
2024-07-19fix: warn user when they are attempting unsupported behaviorSteven Arcangeli
2024-07-19feat: deprecate will_fallback_lsp in favor of list_formatters_to_runSteven Arcangeli
2024-07-19fix: ensure only expected options get passed throughSteven Arcangeli
2024-07-19feat: notify when no formatters available for a bufferSteven Arcangeli
2024-07-19fix: crash in nvim-notifySteven Arcangeli
2024-07-19refactor: deprecate formatter alternation syntaxSteven Arcangeli
2024-07-19feat: format parameter to only run the first available formatterSteven Arcangeli
2024-07-19feat: allow configuring conform.format() args on a per-filetype basisSteven Arcangeli
2024-07-19feat: allow customizing format() defaultsSteven Arcangeli
2024-07-15feat: add undojoin as a format option (#488)Grolaf
* feat: add new format option: undojoin This option allow user to automatically perform undojoin command before formatting. This is useful if the user uses an autosave plugin + format on save, because in case of undo, it will undo the last change AND the formatting. Without this option, it will only undo the formatting. * fix: passed linting * fix: apply undojoin for LSP formatting * doc: fix type annotations for apply_format * doc: regenerate documentation --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-06-19doc: add LSP annotations for `lsp_format` options (#461)Micah Halter
* doc: add LSP annotations for `lsp_format` options * doc: regenerate documentation --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-06-19fix: LSP fallback behavior when formatters not availbleSteven Arcangeli
The bug would present itself when there were formatters configured for a filetype that were not available (not installed, or some other issue). This would also happen if the filetype configured an empty list of formatters. The fix was to make sure that we fall back to LSP formatting _either_ if the filetype had no formatters configured, _or_ if none of the configured formatters are available.
2024-06-17feat!: expand options for LSP formatting (#456)Steven Arcangeli
2024-06-05fix: improve error message when formatter config is missingSteven Arcangeli
2024-05-22doc: add type annotations for setup() functionSteven Arcangeli
2024-05-21docs: better type definitions for top-level functions (#410)Jon Heinritz
* docs: extract conform.format(opts) into it's own class * docs: extract conform.format_lines(opts) into it's own class * refactor: use new nvim_doc_tools capability to remove duplicated class definition --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-05-16ci: test against Neovim 0.10Steven Arcangeli
2024-05-13fix: warning messages for improper async in format_on_save (#401)Steven Arcangeli
2024-04-23fix: refactor deprecated methods in neovim 0.10Steven Arcangeli
2024-03-15feat: add formatter config option to change name of temporary file (#332)Steven Arcangeli
2024-03-01lint: remove unused importSteven Arcangeli
2024-03-01cleanup: remove backwards compatability shimSteven Arcangeli
2024-01-15feat: Add dry_run option and report if buffer was/would be changed by ↵Bronson Jordan
formatters (#273) * feat: add dry_run option and pass return values for if buffer would be modified * fix: implement dry_run for blocking calls to lsp formatter * refactor: change `changed` variable to `did_edit` * docs: Update README * fix: address PR comments * fix: small cleanups --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-01-08feat(formatexpr): don't require LSP range formatting if operating on whole ↵Nuno David
file (#272) solves: https://github.com/stevearc/conform.nvim/issues/271
2024-01-06fix: copy input parameters for will_fallback_lspSteven Arcangeli
2024-01-06fix: pass explicit bufnr to avoid race conditions (#260)Steven Arcangeli
2023-12-26fix(injected): handle inline injections (#251)Steven Arcangeli
2023-12-07fix(formatexpr): does not fallback to the built-in formatexpr (#238)Jongwook Choi
This makes the behavior of formatexpr more consistent with `vim.lsp.formatexpr`; do not run vim's builtin formatter. Problem: When conform's formatexpr is used and (range or buffer) but conform can't do formatting and there is no LSP formatter with the formatting capabilities, it will fall back to the (wrong) built-in formatting, which might result in simply concatenating all the words. This is a breaking change, reverting the behavior introduced in #55.
2023-12-06refactor!: formatter config functions take self as first argument (#233)Steven Arcangeli
This is a breaking API change, but there is a shim in place that will keep existing functions working, just with a warning notification. Most people should not encounter this at all. For anyone overriding a formatter config value with a function that takes `(ctx)` as the parameter, it will need to be updated to take `(self, ctx)`.
2023-11-06fix: nonzero exit code on :wq (#176)Steven Arcangeli
2023-11-04feat: allow formatters_by_ft to be a function (#174)Steven Arcangeli
2023-10-26fix(formatexpr): use default formatexpr if no formatters or LSP clients (#55)Steven Arcangeli
2023-10-15feat!: 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-10fix: prevent format-after-save autocmd from running on invalid buffersSteven Arcangeli
2023-10-10fix: prevent format-on-save autocmd from running on invalid buffers (#128)Chris Bell
2023-10-08feat: errors do not stop formatting earlySteven Arcangeli
2023-10-05feat: expose configuration options for injected formatter (#118)Steven Arcangeli
2023-10-02fix: format on save autocmds ignore nonstandard buffersSteven Arcangeli
2023-10-02fix: injected formatter doesn't have interruption errorsSteven Arcangeli
2023-10-02fix: error handling for injected formatterSteven Arcangeli
2023-09-29fix: alternations follow notification rulesSteven Arcangeli
2023-09-29feat: format injected languages (#83)Steven Arcangeli
2023-09-29fix: format_after_save autocmd blocks nvim exit until completeSteven 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-29fix: only show "no formatters" warning if formatters passed in explicitly (#85)Steven Arcangeli
2023-09-21refactor: rename ruff -> ruff_fixSteven Arcangeli
2023-09-19fix: range formatting for LSP formatters (#63)Steven Arcangeli
2023-09-18doc: remove irrelevant note about '*' filetypeSteven Arcangeli
2023-09-17feat: 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-15feat: '_' filetype to define fallback formattersSteven Arcangeli