fix(lsp): strictly enforce passing offset encoding (#17049)

This removes the "fallback" to utf-16 in many of our helper functions. We
should always explicitly pass these around when possible except in two
locations:

* generating params with help utilities called by buf.lua functions
* the buf.lua functions themselves

Anything that is called by the handler should be passed the offset encoding.
This commit is contained in:
Michael Lingelbach
2022-01-13 02:34:04 -08:00
committed by GitHub
parent e7cd811567
commit bc722c8a74
4 changed files with 133 additions and 65 deletions

View File

@@ -503,7 +503,7 @@ local function on_code_action_results(results, ctx)
---@private
local function apply_action(action, client)
if action.edit then
util.apply_workspace_edit(action.edit)
util.apply_workspace_edit(action.edit, client.offset_encoding)
end
if action.command then
local command = type(action.command) == 'table' and action.command or action