Skip to content

Commit

Permalink
Adapt java/findLinks to use show_document instead of jump_to_location
Browse files Browse the repository at this point in the history
`jump_to_location` is deprecated
  • Loading branch information
mfussenegger committed Nov 19, 2024
1 parent c4279b8 commit e129398
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/jdtls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,12 @@ function M.super_implementation()
request(0, 'java/findLinks', params, function(err, result)
assert(not err, vim.inspect(err))
if result and #result == 1 then
vim.lsp.util.jump_to_location(result[1], offset_encoding, true)
if vim.lsp.util.show_document then
vim.lsp.util.show_document(result[1], offset_encoding, { focus = true })
else
---@diagnostic disable-next-line: deprecated
vim.lsp.util.jump_to_location(result[1], offset_encoding, true)
end
else
assert(result == nil or #result == 0, 'Expected one or zero results for `findLinks`')
vim.notify('No result found')
Expand Down

0 comments on commit e129398

Please sign in to comment.