refactor(lsp): drop str_byteindex/str_utfindex wrappers #30915

* deprecate old signatures
* move to new str_byteindex/str_utfindex signature
* use single-underscore name (double-underscore is reserved for Lua itself)
This commit is contained in:
Tristan Knight
2024-10-26 15:38:25 +01:00
committed by GitHub
parent b922b7d6d7
commit 25b53b593e
12 changed files with 54 additions and 176 deletions

View File

@@ -219,13 +219,13 @@ describe('vim.lsp.diagnostic', function()
eq(1, #result)
eq(
exec_lua(function()
return vim.str_byteindex(line, 7, true)
return vim.str_byteindex(line, 'utf-16', 7)
end),
result[1].col
)
eq(
exec_lua(function()
return vim.str_byteindex(line, 8, true)
return vim.str_byteindex(line, 'utf-16', 8)
end),
result[1].end_col
)