mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +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:
@@ -638,14 +638,14 @@ function M.rename(new_name, opts)
|
||||
local cword = vim.fn.expand('<cword>')
|
||||
|
||||
--- @param range lsp.Range
|
||||
--- @param offset_encoding string
|
||||
local function get_text_at_range(range, offset_encoding)
|
||||
--- @param position_encoding string
|
||||
local function get_text_at_range(range, position_encoding)
|
||||
return api.nvim_buf_get_text(
|
||||
bufnr,
|
||||
range.start.line,
|
||||
util._get_line_byte_from_position(bufnr, range.start, offset_encoding),
|
||||
util._get_line_byte_from_position(bufnr, range.start, position_encoding),
|
||||
range['end'].line,
|
||||
util._get_line_byte_from_position(bufnr, range['end'], offset_encoding),
|
||||
util._get_line_byte_from_position(bufnr, range['end'], position_encoding),
|
||||
{}
|
||||
)[1]
|
||||
end
|
||||
|
Reference in New Issue
Block a user