Skip to content

Commit 361d36e

Browse files
committed
fix(lsp/nightly): set offset encoding in client requests
1 parent 2a190c9 commit 361d36e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lua/haskell-tools/hoogle/init.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ local function mk_lsp_hoogle_signature_handler(options)
2727
end
2828

2929
---@param options table
30-
local function lsp_hoogle_signature(options)
31-
local params = lsp_util.make_position_params()
30+
---@param offset_encoding 'utf-8'|'utf-16'|'utf-32'
31+
local function lsp_hoogle_signature(options, offset_encoding)
32+
local params = lsp_util.make_position_params(0, offset_encoding)
3233
return vim.lsp.buf_request(0, 'textDocument/hover', params, mk_lsp_hoogle_signature_handler(options))
3334
end
3435

@@ -100,9 +101,9 @@ Hoogle.hoogle_signature = function(options)
100101
return
101102
end
102103
local LspHelpers = require('haskell-tools.lsp.helpers')
103-
local clients = LspHelpers.get_clients { bufnr = vim.api.nvim_get_current_buf() }
104+
local clients = LspHelpers.get_active_haskell_clients(vim.api.nvim_get_current_buf())
104105
if #clients > 0 then
105-
lsp_hoogle_signature(options)
106+
lsp_hoogle_signature(options, clients[1].offset_encoding)
106107
else
107108
log.debug('Hoogle signature search: No clients attached. Falling back to <cword>.')
108109
local cword = vim.fn.expand('<cword>')

0 commit comments

Comments
 (0)