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.
|
|
|
|
|
|
|
|
|
|
* 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
|
|
* 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.
|
|
|
|
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.
|
|
|
|
|