mirror of
https://github.com/neovim/neovim.git
synced 2024-12-21 03:35:02 -07:00
fix(lsp): forward offset_encoding in rename handler (#17079)
This commit is contained in:
parent
9304ee3874
commit
8066abcd65
@ -225,9 +225,10 @@ M['textDocument/documentSymbol'] = response_to_list(util.symbols_to_items, 'docu
|
|||||||
M['workspace/symbol'] = response_to_list(util.symbols_to_items, 'symbols')
|
M['workspace/symbol'] = response_to_list(util.symbols_to_items, 'symbols')
|
||||||
|
|
||||||
--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rename
|
--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rename
|
||||||
M['textDocument/rename'] = function(_, result, _)
|
M['textDocument/rename'] = function(_, result, ctx, _)
|
||||||
if not result then return end
|
if not result then return end
|
||||||
util.apply_workspace_edit(result)
|
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||||
|
util.apply_workspace_edit(result, client.offset_encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting
|
--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting
|
||||||
|
@ -737,7 +737,8 @@ end
|
|||||||
|
|
||||||
--- Applies a `WorkspaceEdit`.
|
--- Applies a `WorkspaceEdit`.
|
||||||
---
|
---
|
||||||
---@param workspace_edit (table) `WorkspaceEdit`
|
---@param workspace_edit table `WorkspaceEdit`
|
||||||
|
---@param offset_encoding string utf-8|utf-16|utf-32 (required)
|
||||||
--see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit
|
--see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit
|
||||||
function M.apply_workspace_edit(workspace_edit, offset_encoding)
|
function M.apply_workspace_edit(workspace_edit, offset_encoding)
|
||||||
if offset_encoding == nil then
|
if offset_encoding == nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user