100100--- convert `item` type back to something we can pass to `vim.lsp.util.jump_to_location`
101101--- stopgap for pre-nvim 0.10 - after which we can simply use the `user_data`
102102--- field on the items in `vim.lsp.util.locations_to_items`
103- --- @param item vim.lsp.util.locations_to_items.ret
103+ --- @param item vim.quickfix.entry
104104--- @param offset_encoding string | nil utf-8 | utf-16 | utf-32
105105--- @return lsp.Location
106106local function item_to_location (item , offset_encoding )
134134--- | " textDocument/implementation"
135135
136136--- @param action telescope.lsp.list_or_jump_action
137- --- @param items vim.lsp.util.locations_to_items.ret []
137+ --- @param items vim.quickfix.entry []
138138--- @param opts table
139- --- @return vim.lsp.util.locations_to_items.ret []
139+ --- @return vim.quickfix.entry []
140140local apply_action_handler = function (action , items , opts )
141141 if action == " textDocument/references" and not opts .include_current_line then
142142 local lnum = vim .api .nvim_win_get_cursor (opts .winnr )[1 ]
@@ -148,9 +148,9 @@ local apply_action_handler = function(action, items, opts)
148148 return items
149149end
150150
151- --- @param items vim.lsp.util.locations_to_items.ret []
151+ --- @param items vim.quickfix.entry []
152152--- @param opts table
153- --- @return vim.lsp.util.locations_to_items.ret []
153+ --- @return vim.quickfix.entry []
154154local function filter_file_ignore_patters (items , opts )
155155 local file_ignore_patterns = vim .F .if_nil (opts .file_ignore_patterns , conf .file_ignore_patterns )
156156 file_ignore_patterns = file_ignore_patterns or {}
@@ -242,7 +242,7 @@ local function list_or_jump(action, title, funname, params, opts)
242242 end
243243
244244 local location = item_to_location (item , first_encoding )
245- vim .lsp .util .jump_to_location (location , first_encoding , opts .reuse_win )
245+ vim .lsp .util .show_document (location , first_encoding , { reuse_win = opts .reuse_win } )
246246 else
247247 pickers
248248 .new (opts , {
263263
264264lsp .references = function (opts )
265265 opts .include_current_line = vim .F .if_nil (opts .include_current_line , false )
266+ --- @class lsp.TextDocumentPositionParams
266267 local params = vim .lsp .util .make_position_params (opts .winnr )
267268 params .context = { includeDeclaration = vim .F .if_nil (opts .include_declaration , true ) }
268269 return list_or_jump (" textDocument/references" , " LSP References" , " builtin.lsp_references" , params , opts )
@@ -339,7 +340,7 @@ lsp.document_symbols = function(opts)
339340
340341 local locations = vim .lsp .util .symbols_to_items (result or {}, opts .bufnr ) or {}
341342 locations = utils .filter_symbols (locations , opts , symbols_sorter )
342- if locations == nil then
343+ if vim . tbl_isempty ( locations ) then
343344 -- error message already printed in `utils.filter_symbols`
344345 return
345346 end
@@ -382,7 +383,7 @@ lsp.workspace_symbols = function(opts)
382383
383384 local locations = vim .lsp .util .symbols_to_items (server_result or {}, opts .bufnr ) or {}
384385 locations = utils .filter_symbols (locations , opts , symbols_sorter )
385- if locations == nil then
386+ if vim . tbl_isempty ( locations ) then
386387 -- error message already printed in `utils.filter_symbols`
387388 return
388389 end
@@ -424,7 +425,7 @@ local function get_workspace_symbols_requester(bufnr, opts)
424425 cancel = vim .lsp .buf_request_all (bufnr , " workspace/symbol" , { query = prompt }, tx )
425426
426427 local results = rx () --- @type table<integer , { error : lsp.ResponseError ?, result : lsp.WorkspaceSymbol ?} >
427- local locations = {} --- @type vim.lsp.util.locations_to_items.ret []
428+ local locations = {} --- @type vim.quickfix.entry []
428429
429430 for _ , client_res in pairs (results ) do
430431 if client_res .error then
0 commit comments