mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
629483e24e
Problem: Since [version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments), LSP supports specifying the position encoding (aka offset encoding) supported by the client through `positionEncoding`. Since #31209, Nvim fully supports `utf-8`, `utf-16`, and `utf-32` encodings. Previously, nvim assumed all clients for a buffer had the same `offset_encoding`, so: * Nvim provides `vim.lsp._get_offset_encoding()` to get `offset_encoding`, but this function is incorrect because `offset_encoding` is per-client, not per-buffer. * Based on the strategy of `vim.lsp._get_offset_encoding()`, `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, and `vim.lsp.util.make_given_range_params()` do not require the caller to pass `offset_encoding`, which is invalid. * https://github.com/neovim/neovim/issues/25272 Solution: * Mark `vim.lsp._get_offset_encoding()` as `@deprecated`. * Change the type annotations of `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, `vim.lsp.util.make_given_range_params()` to require the `offset_encoding` param. |
||
---|---|---|
.. | ||
_meta | ||
_changetracking.lua | ||
_meta.lua | ||
_snippet_grammar.lua | ||
_tagfunc.lua | ||
_watchfiles.lua | ||
buf.lua | ||
client.lua | ||
codelens.lua | ||
completion.lua | ||
diagnostic.lua | ||
handlers.lua | ||
health.lua | ||
inlay_hint.lua | ||
log.lua | ||
protocol.lua | ||
rpc.lua | ||
semantic_tokens.lua | ||
sync.lua | ||
util.lua |