diff options
author | Steven Arcangeli <506791+stevearc@users.noreply.github.com> | 2023-08-30 18:34:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 18:34:13 -0700 |
commit | 92393f02efadfb1d9f97c74c8feb853c1caea9de (patch) | |
tree | 980a43e5f6b70c419e089f82074d177aca9da7aa /lua/conform/health.lua | |
parent | c100b8548fd7262a1275bdb867186d0cd94e8b45 (diff) |
feat: apply changes as text edits using LSP utils (#18)
* 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.
Diffstat (limited to 'lua/conform/health.lua')
-rw-r--r-- | lua/conform/health.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lua/conform/health.lua b/lua/conform/health.lua index 195a331..d36ef03 100644 --- a/lua/conform/health.lua +++ b/lua/conform/health.lua @@ -90,6 +90,9 @@ M.show_window = function() seen[formatter.name] = true end append_formatters(buf_formatters) + if vim.tbl_isempty(buf_formatters) then + table.insert(lines, "<none>") + end table.insert(lines, "") table.insert(lines, "Other formatters:") |