@@ -131,7 +131,7 @@ function hover.on_hover(_, result, ctx, config)
131
131
ht .log .debug { ' Hover: Hoogle search for cword' , cword }
132
132
ht .hoogle .hoogle_signature { search_term = cword }
133
133
end )
134
- local params = lsp_util . make_position_params ()
134
+ local params = ctx . params
135
135
local found_location = false
136
136
local found_type_definition = false
137
137
local found_documentation = false
@@ -173,12 +173,11 @@ function hover.on_hover(_, result, ctx, config)
173
173
table.insert (actions , 1 , string.format (' %d. Go to definition at ' .. location_suffix , # actions + 1 ))
174
174
table.insert (_state .commands , function ()
175
175
-- We don't call vim.lsp.buf.definition() because the location params may have changed
176
- local definition_ctx = {
176
+ local definition_ctx = vim . tbl_extend ( ' force ' , ctx , {
177
177
method = ' textDocument/definition' ,
178
- client_id = ctx .client_id ,
179
- }
178
+ })
180
179
ht .log .debug { ' Hover: Go to definition' , definition_result }
181
- vim .lsp .handlers [' textDocument/definition' ](_ , definition_result , definition_ctx )
180
+ vim .lsp .handlers [' textDocument/definition' ](nil , definition_result , definition_ctx )
182
181
end )
183
182
end
184
183
end
@@ -212,12 +211,11 @@ function hover.on_hover(_, result, ctx, config)
212
211
table.insert (actions , 1 , string.format (' %d. Go to type definition at ' .. type_def_suffix , # actions + 1 ))
213
212
table.insert (_state .commands , function ()
214
213
-- We don't call vim.lsp.buf.typeDefinition() because the location params may have changed
215
- local type_definition_ctx = {
214
+ local type_definition_ctx = vim . tbl_extend ( ' force ' , ctx , {
216
215
method = ' textDocument/typeDefinition' ,
217
- client_id = ctx .client_id ,
218
- }
216
+ })
219
217
ht .log .debug { ' Hover: Go to type definition' , type_definition_result }
220
- vim .lsp .handlers [' textDocument/typeDefinition' ](_ , type_definition_result , type_definition_ctx )
218
+ vim .lsp .handlers [' textDocument/typeDefinition' ](nil , type_definition_result , type_definition_ctx )
221
219
end )
222
220
end
223
221
end
0 commit comments