diff options
author | Yi Ming <ofseed@foxmail.com> | 2024-11-26 00:06:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 08:06:05 -0800 |
commit | 165b099fa38c5f4a9855cda3d13575bf63767647 (patch) | |
tree | 543a209711e32e98f37883d77eb8de883a128bef /test/functional/plugin/lsp/incremental_sync_spec.lua | |
parent | a811d4babd22e21a3cd598b097fa0824fcff7fc6 (diff) | |
download | rneovim-165b099fa38c5f4a9855cda3d13575bf63767647.tar.gz rneovim-165b099fa38c5f4a9855cda3d13575bf63767647.tar.bz2 rneovim-165b099fa38c5f4a9855cda3d13575bf63767647.zip |
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`.
Diffstat (limited to 'test/functional/plugin/lsp/incremental_sync_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/incremental_sync_spec.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/plugin/lsp/incremental_sync_spec.lua b/test/functional/plugin/lsp/incremental_sync_spec.lua index f60e159d64..0bca1fa4ca 100644 --- a/test/functional/plugin/lsp/incremental_sync_spec.lua +++ b/test/functional/plugin/lsp/incremental_sync_spec.lua @@ -23,7 +23,7 @@ before_each(function() -- local line_ending = format_line_ending[vim.api.nvim_get_option_value('fileformat', {})] --- @diagnostic disable-next-line:duplicate-set-field - function _G.test_register(bufnr, id, offset_encoding, line_ending) + function _G.test_register(bufnr, id, position_encoding, line_ending) local prev_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, true) local function callback(_, bufnr0, _changedtick, firstline, lastline, new_lastline) @@ -38,7 +38,7 @@ before_each(function() firstline, lastline, new_lastline, - offset_encoding, + position_encoding, line_ending ) @@ -63,15 +63,15 @@ local function test_edit( prev_buffer, edit_operations, expected_text_changes, - offset_encoding, + position_encoding, line_ending ) - offset_encoding = offset_encoding or 'utf-16' + position_encoding = position_encoding or 'utf-16' line_ending = line_ending or '\n' api.nvim_buf_set_lines(0, 0, -1, true, prev_buffer) exec_lua(function() - return _G.test_register(0, 'test1', offset_encoding, line_ending) + return _G.test_register(0, 'test1', position_encoding, line_ending) end) for _, edit in ipairs(edit_operations) do |