Skip to content

Commit

Permalink
fix: offset_encoding is required now
Browse files Browse the repository at this point in the history
Adapt to the upstream change neovim/neovim@629483e
  • Loading branch information
rockyzhang24 committed Nov 29, 2024
1 parent ad8f0a4 commit 0ceca4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/nvim-treesitter/textobjects/lsp_interop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ function M.peek_definition_code(query_string, query_group, lsp_request, context)
if vim.tbl_contains(vim.api.nvim_list_wins(), floating_win) then
vim.api.nvim_set_current_win(floating_win)
else
local params = vim.lsp.util.make_position_params()
local win_id = vim.api.nvim_get_current_win()
local params = vim.fn.has "nvim-0.11" == 0 and vim.lsp.util.make_position_params()
or function(client)
return vim.api.util.make_position_params(win_id, client.offset_encoding)
end
return vim.lsp.buf_request(
0,
lsp_request,
Expand Down

0 comments on commit 0ceca4e

Please sign in to comment.