summaryrefslogtreecommitdiffstats
path: root/lua/conform/runner.lua
AgeCommit message (Collapse)Author
2024-07-16fix: display stdout as error message if stderr is empty (#486)Steven 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-07-01feat(shfmt): add automatic indentation detection (#481)Micah Halter
* feat(shfmt): automatically detect indentation * fix(markdown-toc): improve correctness of indentation size calculation * fix(djlint): improve correctness of indentation size calculation * feat: add effective `shiftwidth` to `conform.Context` this also refactors formatters that automatically set indentation level to use the new shiftwidth context
2024-06-05fix: always add cwd to debug logsSteven Arcangeli
2024-06-03fix: set correct file extension for unsaved buffer temp files (#440)emmanueltouzery
the extension used to be always the file type, be smarter now. For instance prettier wouldn't recognize a `.typescript` extension.
2024-06-01ci: use nvim-typecheck-action v2Steven Arcangeli
2024-05-16ci: test against Neovim 0.10Steven Arcangeli
2024-05-13fix: lazily compute relative filepathSteven Arcangeli
2024-05-07feat: formatters can use $RELATIVE_FILEPATH in args (#349)Steven Arcangeli
2024-04-13fix: handle windows line ending when config.stdin is true (#361)Li BingMuyou
2024-03-15feat: add formatter config option to change name of temporary file (#332)Steven Arcangeli
2024-03-01cleanup: remove backwards compatability shimSteven Arcangeli
2024-01-21fix: handle windows line endings (#274)Steven 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-02Fix(black): formatting excluded files results in blank buffer (#254)Eric Bartels
* Fix(black): formatting excluded files results in blank buffer (#249) * Fixed stylua formatting * Fixed more stylua formatting * Log buffer name and change from trace to warning * Test fix: set_formatter_output funtion was moved out of test_util * Avoid blank output triggering errors in fuzzer tests
2023-12-26fix(injected): handle inline injections (#251)Steven Arcangeli
2023-12-23fix: crash in error handlingSteven Arcangeli
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-18fix: range format method for async formatters and injectedSteven Arcangeli
2023-11-06fix: catch jobstart errors (#183)Steven Arcangeli
2023-10-08fix: handle one failure mode with range formatting (#123)Steven Arcangeli
2023-10-08feat: errors do not stop formatting earlySteven Arcangeli
2023-10-05feat: expose configuration options for injected formatter (#118)Steven Arcangeli
2023-10-05doc: typo in runner.lua (#112)Ikko Eltociear Ashimine
ocurred -> occurred
2023-10-02fix: injected formatter doesn't have interruption errorsSteven Arcangeli
2023-09-29fix: injected formatter hangs on empty fileSteven Arcangeli
2023-09-29fix: format_after_save blocks on exit for lsp formattingSteven 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-16fix: unify timeout error message format with LSPSteven Arcangeli
2023-09-15feat: allow running commands in a shell (#49)Steven Arcangeli
2023-09-12fix: modify diff calculation to handle end-of-file newlines better (#35)Steven Arcangeli
2023-08-31feat: 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-30feat: 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-29feat: notify when formatter errors, and add notify_on_error config option (#16)Steven Arcangeli
2023-08-29feat: display last few lines of the log file in :ConformInfoSteven Arcangeli
2023-08-29feat: formatter config function is passed the buffer number (#9)Steven Arcangeli
2023-08-29feat: add support for environment variables (#8)Steven Arcangeli
2023-08-28feat: range formattingSteven 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-28feat: can silence notification when running formatters (#7)Steven Arcangeli
2023-08-27lint: fix type annotationsSteven Arcangeli
2023-08-27fix: no need to save/restore window viewSteven Arcangeli
Since we're applying diffs instead of replacing the entire buffer, the cursor actually stays in a more predictable location if we _don't_ try to save & restore the window views.
2023-08-27test: add a test suiteSteven Arcangeli
2023-08-26fix: gracefully handle another timeout caseSteven Arcangeli
2023-08-25fix: ensure real buffer numbers get loggedSteven Arcangeli
2023-08-25fix: don't modify files when no styling changesSteven Arcangeli
2023-08-25feat: first working versionSteven Arcangeli