feat(lsp): include positionEncodings in default client capabilities

This commit is contained in:
Gregory Anders 2023-06-01 11:39:51 -05:00
parent fb54e6980e
commit 15641f38cf
2 changed files with 13 additions and 0 deletions

View File

@ -39,6 +39,12 @@ ADDED FEATURES *news-added*
The following new APIs or features were added. The following new APIs or features were added.
• 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.
• Dynamic registration of LSP capabilities. An implication of this change is that checking a client's `server_capabilities` is no longer a sufficient indicator to see if a server supports a feature. Instead use `client.supports_method(<method>)`. It considers both the dynamic capabilities and static `server_capabilities`. • Dynamic registration of LSP capabilities. An implication of this change is that checking a client's `server_capabilities` is no longer a sufficient indicator to see if a server supports a feature. Instead use `client.supports_method(<method>)`. It considers both the dynamic capabilities and static `server_capabilities`.
• |vim.iter()| provides a generic iterator interface for tables and Lua • |vim.iter()| provides a generic iterator interface for tables and Lua
iterators |luaref-in|. iterators |luaref-in|.

View File

@ -634,6 +634,13 @@ export interface WorkspaceClientCapabilities {
--- capabilities. --- capabilities.
function protocol.make_client_capabilities() function protocol.make_client_capabilities()
return { return {
general = {
positionEncodings = {
'utf-8',
'utf-16',
'utf-32',
},
},
textDocument = { textDocument = {
semanticTokens = { semanticTokens = {
dynamicRegistration = false, dynamicRegistration = false,