]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Inform language servers that we really only supports utf-32
authorAndreas Louv <andreas@louv.dk>
Fri, 31 Mar 2023 16:07:10 +0000 (18:07 +0200)
committerAndreas Louv <andreas@louv.dk>
Fri, 31 Mar 2023 20:22:17 +0000 (22:22 +0200)
autoload/lsp/lspserver.vim

index fc22eec30b3f38029132588e7ca36c9507948cea..b7da5371154e85d70d76669b45199b9e9a5c4a33 100644 (file)
@@ -438,7 +438,16 @@ def InitServer(lspserver: dict<any>)
       }
     },
     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'