aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-06-05 08:21:23 -0500
committerGitHub <noreply@github.com>2023-06-05 08:21:23 -0500
commitca26ec34386dfe98b0edf3de9aeb7b66f40d5efd (patch)
treeecfab5440ecb9c9d0badf5f9ca1bd75cf9d71bd1
parent21187e1c73e6887ce407164c98320555374387a9 (diff)
downloadrneovim-ca26ec34386dfe98b0edf3de9aeb7b66f40d5efd.tar.gz
rneovim-ca26ec34386dfe98b0edf3de9aeb7b66f40d5efd.tar.bz2
rneovim-ca26ec34386dfe98b0edf3de9aeb7b66f40d5efd.zip
fix(lsp): use only utf-16 in default client positionEncodings (#23903)
The Nvim client does not yet support multiple offset encodings for clients in the same buffer. Until it does, stick to utf-16 by default.
-rw-r--r--runtime/doc/news.txt8
-rw-r--r--runtime/lua/vim/lsp/protocol.lua2
2 files changed, 3 insertions, 7 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 8fe01c4dfb..0182605b1b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -44,11 +44,9 @@ The following new APIs or features were added.
• Neovim's LSP client now always saves and restores named buffer marks when
applying text edits.
-• Nvim's LSP client now advertises the general.positionEncodings client
- capability to indicate to servers that it supports utf-8, utf-16, and utf-32
- encodings. If the server responds with the positionEncoding capability in
- its initialization response, Nvim automatically sets the client's
- `offset_encoding` field.
+• Nvim now supports the `positionEncoding` server capability. If a server
+ responds with the `positionEncoding` capability in its initialization
+ response, Nvim automatically sets the client's `offset_encoding` field.
• Dynamic registration of LSP capabilities. An implication of this change is
that checking a client's `server_capabilities` is no longer a sufficient
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 7e49a572e7..7558b5c6ba 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -636,9 +636,7 @@ function protocol.make_client_capabilities()
return {
general = {
positionEncodings = {
- 'utf-8',
'utf-16',
- 'utf-32',
},
},
textDocument = {