From 0da0b0bacbd652d0b6b6e5b168358de90fda0af7 Mon Sep 17 00:00:00 2001 From: Andreas Louv Date: Fri, 31 Mar 2023 18:07:10 +0200 Subject: [PATCH] Inform language servers that we really only supports utf-32 --- autoload/lsp/lspserver.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index fc22eec..b7da537 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -438,7 +438,16 @@ def InitServer(lspserver: dict) } }, window: {}, - general: {} + general: { + # Currently we always send character count as position offset, + # which meanas only utf-32 is supported. + # Adding utf-16 simply for good mesure, as I'm scared some servers will + # give up if they don't support utf-32 only. + positionEncodings: ['utf-32', 'utf-16'] + }, + # This is the way clangd expects to be informated about supported encodings: + # https://clangd.llvm.org/extensions#utf-8-offsets + offsetEncoding: ['utf-32', 'utf-16'] } # interface 'InitializeParams' -- 2.48.1