diff options
| author | Rocky <yzhang.rocky@gmail.com> | 2024-11-23 16:57:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-24 08:57:50 +0800 |
| commit | 022134a75c5189e87b0aef1c7e1db1921ec4073f (patch) | |
| tree | c4a007754c0506c52b3bc2a9d1d87ff5633fecaa /lua/lspconfig | |
| parent | chore: add LuaLS type checking (#3447) (diff) | |
| download | nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.tar nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.tar.gz nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.tar.bz2 nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.tar.lz nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.tar.xz nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.tar.zst nvim-lspconfig-022134a75c5189e87b0aef1c7e1db1921ec4073f.zip | |
fix: pass offset_encoding in some make params util functions(#3449)
Diffstat (limited to 'lua/lspconfig')
| -rw-r--r-- | lua/lspconfig/configs/clangd.lua | 3 | ||||
| -rw-r--r-- | lua/lspconfig/configs/texlab.lua | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lua/lspconfig/configs/clangd.lua b/lua/lspconfig/configs/clangd.lua index 06c75095..4972be5b 100644 --- a/lua/lspconfig/configs/clangd.lua +++ b/lua/lspconfig/configs/clangd.lua @@ -27,7 +27,8 @@ local function symbol_info() if not clangd_client or not clangd_client.supports_method 'textDocument/symbolInfo' then return vim.notify('Clangd client not found', vim.log.levels.ERROR) end - local params = vim.lsp.util.make_position_params() + local win = vim.api.nvim_get_current_win() + local params = vim.lsp.util.make_position_params(win, clangd_client.offset_encoding) clangd_client.request('textDocument/symbolInfo', params, function(err, res) if err or #res == 0 then -- Clangd always returns an error, there is not reason to parse it diff --git a/lua/lspconfig/configs/texlab.lua b/lua/lspconfig/configs/texlab.lua index 79925086..919199bd 100644 --- a/lua/lspconfig/configs/texlab.lua +++ b/lua/lspconfig/configs/texlab.lua @@ -12,7 +12,9 @@ local function client_with_fn(fn) end local function buf_build(client, bufnr) - client.request('textDocument/build', vim.lsp.util.make_position_params(), function(err, result) + local win = vim.api.nvim_get_current_win() + local params = vim.lsp.util.make_position_params(win, client.offset_encoding) + client.request('textDocument/build', params, function(err, result) if err then error(tostring(err)) end @@ -27,7 +29,9 @@ local function buf_build(client, bufnr) end local function buf_search(client, bufnr) - client.request('textDocument/forwardSearch', vim.lsp.util.make_position_params(), function(err, result) + local win = vim.api.nvim_get_current_win() + local params = vim.lsp.util.make_position_params(win, client.offset_encoding) + client.request('textDocument/forwardSearch', params, function(err, result) if err then error(tostring(err)) end @@ -91,9 +95,10 @@ local function command_factory(cmd) end local function buf_find_envs(client, bufnr) + local win = vim.api.nvim_get_current_win() client.request('workspace/executeCommand', { command = 'texlab.findEnvironments', - arguments = { vim.lsp.util.make_position_params() }, + arguments = { vim.lsp.util.make_position_params(win, client.offset_encoding) }, }, function(err, result) if err then return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR) |
