From 99c69c4e9ce40fcb01f41f1b1edf54fe6bf288f5 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 12 Jun 2023 01:12:05 +0200 Subject: [PATCH] fix(clangd): use same offsetEncoding as null-ls --- modules/languages/clang.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/languages/clang.nix b/modules/languages/clang.nix index c7f421f..32e02f9 100644 --- a/modules/languages/clang.nix +++ b/modules/languages/clang.nix @@ -24,8 +24,11 @@ with builtins; let clangd = { package = pkgs.clang-tools; lspConfig = '' + local clangd_cap = capabilities + -- use same offsetEncoding as null-ls + clangd_cap.offsetEncoding = {"utf-16"} lspconfig.clangd.setup{ - capabilities = capabilities; + capabilities = clangd_cap; on_attach=default_on_attach; cmd = {"${cfg.lsp.package}/bin/clangd"}; ${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.opts}"}