From e129398e171e87c0d9e94dd5bea7eb4730473ffc Mon Sep 17 00:00:00 2001 From: Mathias Fussenegger Date: Mon, 18 Nov 2024 18:54:56 +0100 Subject: [PATCH] Adapt `java/findLinks` to use show_document instead of jump_to_location `jump_to_location` is deprecated --- lua/jdtls.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/jdtls.lua b/lua/jdtls.lua index 6d6a66d..0ae7c21 100644 --- a/lua/jdtls.lua +++ b/lua/jdtls.lua @@ -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')