mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
refactor(lsp): rename offset_encoding to position_encoding #31286
Problem: LSP spec uses the term "position encoding" where we say "offset encoding". Solution: - Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking). - Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
This commit is contained in:
@@ -550,7 +550,7 @@ local function on_complete_done()
|
||||
return
|
||||
end
|
||||
|
||||
local offset_encoding = client.offset_encoding or 'utf-16'
|
||||
local position_encoding = client.offset_encoding or 'utf-16'
|
||||
local resolve_provider = (client.server_capabilities.completionProvider or {}).resolveProvider
|
||||
|
||||
local function clear_word()
|
||||
@@ -576,7 +576,7 @@ local function on_complete_done()
|
||||
|
||||
if completion_item.additionalTextEdits and next(completion_item.additionalTextEdits) then
|
||||
clear_word()
|
||||
lsp.util.apply_text_edits(completion_item.additionalTextEdits, bufnr, offset_encoding)
|
||||
lsp.util.apply_text_edits(completion_item.additionalTextEdits, bufnr, position_encoding)
|
||||
apply_snippet_and_command()
|
||||
elseif resolve_provider and type(completion_item) == 'table' then
|
||||
local changedtick = vim.b[bufnr].changedtick
|
||||
@@ -591,7 +591,7 @@ local function on_complete_done()
|
||||
if err then
|
||||
vim.notify_once(err.message, vim.log.levels.WARN)
|
||||
elseif result and result.additionalTextEdits then
|
||||
lsp.util.apply_text_edits(result.additionalTextEdits, bufnr, offset_encoding)
|
||||
lsp.util.apply_text_edits(result.additionalTextEdits, bufnr, position_encoding)
|
||||
if result.command then
|
||||
completion_item.command = result.command
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user