mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 11:55:34 +00:00
fix(lsp): pass offset_encoding in formatexpr() (#18084)
This commit is contained in:
@@ -1719,9 +1719,9 @@ function lsp.formatexpr(opts)
|
|||||||
local client_results = vim.lsp.buf_request_sync(0, "textDocument/rangeFormatting", params, timeout_ms)
|
local client_results = vim.lsp.buf_request_sync(0, "textDocument/rangeFormatting", params, timeout_ms)
|
||||||
|
|
||||||
-- Apply the text edits from one and only one of the clients.
|
-- Apply the text edits from one and only one of the clients.
|
||||||
for _, response in pairs(client_results) do
|
for client_id, response in pairs(client_results) do
|
||||||
if response.result then
|
if response.result then
|
||||||
vim.lsp.util.apply_text_edits(response.result, 0)
|
vim.lsp.util.apply_text_edits(response.result, 0, vim.lsp.get_client_by_id(client_id).offset_encoding)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user