fix: added global position encoding

This commit is contained in:
dlond 2025-09-06 12:55:48 +12:00 committed by Daniel Lond
parent 161310a072
commit 49581942c7
2 changed files with 13 additions and 11 deletions

View File

@ -9,6 +9,9 @@ function M.setup()
pcall(function() pcall(function()
capabilities = require('blink.cmp').get_lsp_capabilities() capabilities = require('blink.cmp').get_lsp_capabilities()
end) end)
--
-- Set global position encoding preference
capabilities.offsetEncoding = { 'utf-8', 'utf-16' }
-- Load server configurations -- Load server configurations
local servers = require('plugins.config.lsp.servers').get_servers() local servers = require('plugins.config.lsp.servers').get_servers()
@ -24,3 +27,4 @@ function M.setup()
end end
return M return M

View File

@ -6,9 +6,9 @@ local util = require 'lspconfig.util'
-- Get clang-wrapper resource-root for Nix environments -- Get clang-wrapper resource-root for Nix environments
local function get_clang_resource_dir() local function get_clang_resource_dir()
-- Try to find clang-wrapper's resource-root -- Try to find clang-wrapper's resource-root
local handle = io.popen('ls -d /nix/store/*clang-wrapper*/resource-root 2>/dev/null | head -1') local handle = io.popen 'ls -d /nix/store/*clang-wrapper*/resource-root 2>/dev/null | head -1'
if handle then if handle then
local resource_root = handle:read('*l') local resource_root = handle:read '*l'
handle:close() handle:close()
if resource_root and resource_root ~= '' then if resource_root and resource_root ~= '' then
return resource_root return resource_root
@ -72,7 +72,6 @@ function M.get_servers()
}, },
}, },
}, },
positionEncoding = 'utf-8',
}, },
-- Python Linter/Formatter -- Python Linter/Formatter
@ -106,4 +105,3 @@ function M.get_servers()
end end
return M return M