aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/handlers.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2022-01-13 06:47:35 -0800
committerGitHub <noreply@github.com>2022-01-13 06:47:35 -0800
commit9304ee3874fc1e0608a9902cf5b1b0ac6645ef0a (patch)
tree4635ac7b5a46892c1f5ce781ce0efd51c10d6737 /runtime/lua/vim/lsp/handlers.lua
parent4570df0b434f16ac9bdd71d178e297a40ef6e34a (diff)
downloadrneovim-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.lua6
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