diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2022-01-13 06:47:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 06:47:35 -0800 |
commit | 9304ee3874fc1e0608a9902cf5b1b0ac6645ef0a (patch) | |
tree | 4635ac7b5a46892c1f5ce781ce0efd51c10d6737 /runtime/lua/vim/lsp/handlers.lua | |
parent | 4570df0b434f16ac9bdd71d178e297a40ef6e34a (diff) | |
download | rneovim-9304ee3874fc1e0608a9902cf5b1b0ac6645ef0a.tar.gz rneovim-9304ee3874fc1e0608a9902cf5b1b0ac6645ef0a.tar.bz2 rneovim-9304ee3874fc1e0608a9902cf5b1b0ac6645ef0a.zip |
fix(lsp): forward offset_encoding to apply_text_edits (#17075)
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 6378ed0749..4c0ca28bb9 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -233,13 +233,15 @@ end --see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting M['textDocument/rangeFormatting'] = function(_, result, ctx, _) if not result then return end - util.apply_text_edits(result, ctx.bufnr) + local client = vim.lsp.get_client_by_id(ctx.client_id) + util.apply_text_edits(result, ctx.bufnr, client.offset_encoding) end --see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting M['textDocument/formatting'] = function(_, result, ctx, _) if not result then return end - util.apply_text_edits(result, ctx.bufnr) + local client = vim.lsp.get_client_by_id(ctx.client_id) + util.apply_text_edits(result, ctx.bufnr, client.offset_encoding) end --see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion |